[英]Maven surefire plugin doesn't find unit tests
<configuration>
<includes>
<include>**/*Test.java</include>
</includes>
</configuration>
And I still get the following error on mvn test:我仍然在 mvn 测试中收到以下错误:
--- maven-surefire-plugin:2.22.2:test (default-test) @ <project-name> ---
[INFO] No tests to run.
What do I do wrong?我做错了什么?
Is there any reason why you configure just a certain tests?有什么理由只配置某些测试吗? By default the surefire plugin should access all classes in testRoot and sub directories.默认情况下,surefire 插件应该访问 testRoot 和子目录中的所有类。
You could also just link a specific file like你也可以只链接一个特定的文件,比如
src/test/ArchTest.java src/测试/ArchTest.java
to see if it is the "include" in your configuration or something else.查看它是否是您的配置中的“包含”或其他内容。 I am not sure that the wildecards are working as you expect them to work.我不确定通配符是否像您期望的那样工作。 See Maven <include> wildcard match on partial folder name .请参阅Maven <include> wildcard match on partial folder name 。 Based on this you might try out基于此,您可以尝试
<configuration>
<includes>
<include>/**/*Test.java</include>
</includes>
</configuration>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.