【问题标题】:exclude TestNG-Groups on maven build in hudson在 hudson 中排除 Maven 构建上的 TestNG-Groups
【发布时间】:2011-11-03 16:17:45
【问题描述】:

我想使用 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 中删除,但这似乎是正确的,因为我需要为我拥有的每个配置文件重复它。

非常感谢任何帮助

【问题讨论】:

    标签: maven hudson testng maven-failsafe-plugin


    【解决方案1】:

    通过定义一个属性“testGroupsToSkip”解决了这个问题,该属性在 main-pom.xml 中设置。然后将其用作 excludedGroups 的值。在我的个人资料中,我用新值覆盖了该属性。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-04-02
      • 1970-01-01
      • 2012-02-15
      • 2011-08-05
      • 2019-05-16
      • 2013-01-20
      • 2012-08-20
      相关资源
      最近更新 更多