从eclipse构建时,测试类是在target / test-classes下生成的,但是当我运行时它是空的(只有测试资源是副本但没有测试类)
mvn clean install
我看到以下消息
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile)
@ core --- [WARNING] File encoding has not been set, using platform
encoding US-ASCII, i.e. build is platform dependent! [INFO] Compiling
46 source files to
/Users/root/Perforce/Server/DL/Server/dev/core/target/test-classes
[INFO] [INFO] --- maven-surefire-plugin:2.17:test (default-test) @
core ---
想知道这些课程去了哪里。我跑的时候
mvn -X install
我看到了
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile)
@ core --- [WARNING] File encoding has not been set, using platform
encoding US-ASCII, i.e. build is platform dependent! [INFO] Compiling
46 source files to
/Users/root/Perforce/Server/DL/Server/dev/core/target/test-classes
[INFO] [INFO] --- maven-surefire-plugin:2.17:test (default-test) @
core ---
[DEBUG] Output directory:
/Users/root/Perforce/Server/DL/Server/dev/core/target/test-classess
[DEBUG] CompilerReuseStrategy: reuseCreated [DEBUG]
useIncrementalCompilation enabled [DEBUG] Stale source detected:
/Users/root/Perforce/Server/DL/Server/dev/core/src/test/java/test/datastore/FileTest.java
以及所有其他文件。
请建议任何方法进一步调试为什么编译的测试类不存在,以便测试可以在下一阶段运行。
请注意,这是父项目下的子项目,所有其他子项目的测试类都已编译并运行,但不是这个。奇怪的是,父POM具有所有设置,所以不确定这个
有什么特别之处答案 0 :(得分:0)
我终于找到了问题。以下文件中提到的模式忽略了与模式
不匹配的测试用例src/test/resources/META-INF/services/javax.annotation.processing.Processor
我从
改变了模式test.MyAnnotation
到
#test.MyAnnotation
它有效!任何猜测是什么问题,是否有选择地运行测试?