maven - Maven - 能够运行一组测试但不能运行单个测试
问题描述
在我的 pom 文件中,我将组定义为
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>
-javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
</argLine>
<groups>Web</groups>
</configuration>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
</plugin>
当我使用以下命令行在控制台中运行时,它可以工作
mvn -Dgroups=Web
然而,当我跑一个像
mvn -Dtest=MyTest
Maven 显示错误[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M4:test (default-cli) on project test-benchmarks: No tests were executed!(设置 -DfailIfNoTests=false 以忽略此错误。) -> [Help 1]
因此,我必须删除<groups>Web</groups>
POM 文件中的标记,才能正常运行单个测试。有没有人帮我修复它?谢谢
解决方案
推荐阅读
- javascript - 破表过滤器
- apache-spark - 执行程序内存:已用内存与用于存储数据的总可用内存,例如缓存在内存中的 RDD 分区
- php - 如何根据变量更改输入值?
- ios - 使用 SwiftUI 模拟 CSS flex-wrap 行为
- bash - Bash:在远程主机上作为 sudo 运行函数?
- load - Snowflake - 通过 Web UI 加载数据所需的权限
- postgresql - Postgres 更快地按计算字段排序
- docker - 从 Jenkins docker 容器 SSH 到远程主机
- python - 如何删除列表中不存在的数据框值?
- jenkins - 在 jenkins 管道中尝试循环 http 请求