我还没有找到这个问题的答案,但在我的poms中,我有:
<plugin>
<groupId>org.scalatest</groupId>
<artifactId>scalatest-maven-plugin</artifactId>
<version>1.0</version>
<configuration>
<tagsToExclude>
TestTag
</tagsToExclude>
...我想要一种只运行标记为TestTag的测试的方法。我试过跑步
mvn test -DtagsToInclude=TestTag但是因为TestTag已经被排除在poms之外,所以所有的测试都会被跳过。我还尝试了重置pom属性:
mvn test -DtagsToExclude=None -DtagsToInclude=TestTag但是覆盖不起作用,所有的测试都会被再次跳过。
发布于 2017-07-19 23:56:58
这对我来说很有效,我只需要添加带有tagsToExclude属性的配置文件:
<profiles>
<profile>
<id>default</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<tagsToExclude>TestTag</tagsToExclude>
</properties>
</profile>
</profiles>
<plugin>
<groupId>org.scalatest</groupId>
<artifactId>scalatest-maven-plugin</artifactId>
<version>1.0</version>
<configuration>
<tagsToExclude>${tagsToExclude}</tagsToExclude>现在你可以运行你的命令了,它可以工作了:
mvn test -DtagsToExclude=None -DtagsToInclude=TestTag参考:请参阅此博客(我不是作者) https://technicaltesting.wordpress.com/tag/scalatest-maven-plugin/。
https://stackoverflow.com/questions/38507678
复制相似问题