【发布时间】:2016-02-19 22:41:35
【问题描述】:
你能告诉我如何使用以下配置在命令行中调用 maven surefire 吗?
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<executions>
<execution>
<id>Custom tests</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<classesDirectory>target/generated/classes/normalCase/</classesDirectory>
<reportsDirectory>target/generated/reports/normalCase/</reportsDirectory>
</configuration>
</execution>
</executions>
</plugin>
当在我的 pom.xml 中这样定义 surefire 并且我执行阶段测试时,它会完全按照我希望的方式工作:它会尝试在位于目标/生成/类/normalCase 中的类上运行我的测试。
所以我尝试了这个命令行:
mvn surefire:test -DclassesDirectory="target/generated/classes/normalCase/"
但是不,它会一直检查默认值目录“target/classes”中的类。
那么我怎样才能在命令行中实现呢?
【问题讨论】:
标签: java maven maven-surefire-plugin