原创

maven 过滤test

maven 打包错误

[WARNING] /D:/kaifa/idea-workspasce2018/DBlog/blog-web/src/test/java/com/zyd/blog/BaseJunitTest.java: D:\kaifa\idea-workspasce2018\DBlog\blog-web\src\test\java\com\zyd\blog\BaseJunitTest.java使用或覆盖了已过时的 API。 [WARNING] /D:/kaifa/idea-workspasce2018/DBlog/blog-web/src/test/java/com/zyd/blog/BaseJunitTest.java: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。 [INFO] [INFO] --- maven-surefire-plugin:2.18.1:test (default-test) @ blog-web --- [INFO] Surefire report directory: D:\kaifa\idea-workspasce2018\DBlog\blog-web\target\surefire-reports ------------------------------------------------------- T E S T S ------------------------------------------------------- Running com.zyd.blog.BaseJunitTest Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.003 sec <<< FAILURE! - in com.zyd.blog.BaseJunitTest initializationError(com.zyd.blog.BaseJunitTest) Time elapsed: 0.002 sec <<< ERROR! java.lang.Exception: No runnable methods at org.junit.runners.BlockJUnit4ClassRunner.validateInstanceMethods(BlockJUnit4ClassRunner.java:191) at org.junit.runners.BlockJUnit4ClassRunner.collectInitializationErrors(BlockJUnit4ClassRunner.java:128) at org.junit.runners.ParentRunner.validate(ParentRunner.java:416) at org.junit.runners.ParentRunner.<init>(ParentRunner.java:84) at org.junit.runners.BlockJUnit4ClassRunner.<init>(BlockJUnit4ClassRunner.java:65) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.<init>(SpringJUnit4ClassRunner.java:138) at org.springframework.test.context.junit4.SpringRunner.<init>(SpringRunner.java:49) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104) at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283) at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103) Running com.zyd.blog.controller.RestApiControllerTest

pom 加上:

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

。。。




正文到此结束
Loading...