每个分类器的maven运行测试

时间:2011-12-15 09:35:35

标签: maven

我有一个maven war项目,它配置为使用多个分类器构建多个env。以下是我为dev和test envs配置插件的方法:

<plugin>
   <artifactId>maven-war-plugin</artifactId>   
   <executions>
       <execution>
       <id>package-dev</id>
       <phase>package</phase>
       <configuration>
           <classifier>dev</classifier>                                                         <webappDirectory>${project.build.directory}/${project.build.finalName}-dev</webappDirectory>
           <webResources>
                <resource>
                    <directory>src/env/dev</directory>
                </resource>
           </webResources>
       </configuration>
       <goals>
           <goal>war</goal>
       </goals>
     </execution>
     <execution>
       <id>package-test</id>
       <phase>package</phase>
       <configuration>
       <classifier>test</classifier>                                            <webappDirectory>${project.build.directory}/${project.build.finalName}-test</webappDirectory>
       <webResources>
          <resource>
            <directory>src/env/test</directory>
          </resource>
       </webResources>
    </configuration>
    <goals>
       <goal>war</goal>
    </goals>
  </execution>
</executions>

但是,我希望我的测试基于每个分类器被覆盖的属性文件在每个分类器上执行,以确保所有测试都将在每个环境中传递。我怎样才能做到这一点?

谢谢,

肖恩

0 个答案:

没有答案