【问题标题】:Maven test in a different phase不同阶段的 Maven 测试
【发布时间】:2013-02-21 21:37:42
【问题描述】:

目前我有一些非常繁重的测试,我只想在安装 Maven 包之前运行它们。我无法将其传达给我的 pom,目前包括:

 <plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-surefire-plugin</artifactId>
   <version>2.13</version>
   <executions>
     <execution>
       <id>dummied-test</id>
       <phase>test</phase>
       <goals>
         <goal>test</goal>
       </goals>
       <configuration>
         <skip>true</skip>
       </configuration>
     </execution>
     <execution>
       <id>test-in-verify-phase</id>
       <phase>verify</phase>
       <goals>
         <goal>test</goal>
       </goals>
     </execution>
   </executions>
 </plugin>

你可以猜到我 1) 首先尝试将其绑定到 verify 阶段,2) 尝试将其显式添加到 test 阶段而没有目标,3) 将其添加到 test 阶段与 @987654325 @设置为真...

如何告诉 Maven 在测试阶段不要运行测试?

【问题讨论】:

    标签: unit-testing maven


    【解决方案1】:

    需要在executions标签之外添加configuration标签。为什么?我不完全理解这一点,但我想我只是添加了另一个跳过测试的执行。根据此资源:http://docs.codehaus.org/pages/viewpage.action?pageId=62120

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-10-26
      • 1970-01-01
      • 2012-09-22
      • 2023-03-23
      • 1970-01-01
      • 2014-11-27
      • 2014-11-14
      • 2012-07-08
      相关资源
      最近更新 更多