解決maven打包異常:Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2

項目在引入org.junit.Test 做單測時,maven不管是操作package還是install一直報錯,提示:

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project gulimall-coupon: There are test failures.

Please refer to D:\m1\0613\mall-coupon\target\surefire-reports for the individual test results.
Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.

解決方法:

pom文件指定skipTests爲true,跳過單測
在這裏插入圖片描述

...
<build>
    <plugins>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.22.2</version>
            <configuration>
                <skipTests>true</skipTests>
            </configuration>
        </plugin>
    </plugins>

</build>

</project>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章