在 hudson 中的 Maven 构建中排除 TestNG-Groups
我想使用 hudson 构建一个 maven-java 项目。我的一些集成测试使用无法从 hudson-server 访问的服务器。所以我想使用特殊的配置文件排除它们。
<profile>
<id>hudson</id>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<excludedGroups>ticketserver,print</excludedGroups>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
</profile
不幸的是,我已经在我的常规 pom 中排除了一个组。
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.10</version>
<configuration>
<excludedGroups>manual</excludedGroups>
</configuration>
使用 mvn help: effective-pom 我发现此设置会覆盖我的个人资料中的设置。在 hudson 配置文件中运行时是否有办法排除所有三个测试类?
我想将故障配置放入我拥有的每个配置文件中,并将其从通用 pom 中删除,但这似乎是正确的,因为我需要为我拥有的每个配置文件重复它。
非常感谢任何帮助
I want to use hudson to build a maven-java project. Some of my integration tests use servers which are not reachable from the hudson-server. So i want to exclude them using a special profile.
<profile>
<id>hudson</id>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<excludedGroups>ticketserver,print</excludedGroups>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
</profile
Unfortunatly i am already excluding a group in my general pom.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.10</version>
<configuration>
<excludedGroups>manual</excludedGroups>
</configuration>
Using mvn help:effective-pom i found out, that this setting overrides the one from my profile. Is there are way exclude all three test-classes when running in the hudson profile?
I though about putting the failsage-configuration in to every profile i have and removing it from the general pom but that does seem right, as i would need to repeat it for every profile i have.
Any help is greatly appreciated
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过定义属性“testGroupsToSkip”解决了这个问题,该属性在 main-pom.xml 中设置。然后将其用作 excludedGroups 的值。在我的个人资料中,我用新值覆盖该属性。
Solved this by defining a property "testGroupsToSkip", which is set in the main-pom. it is then used as the value for excludedGroups. In my Profile i overwrite the property with the new value.