質問への回答を参照してください:How can I switch between two test suites in Maven 2? 私はmavenモジュールが好きです。実装が非常に簡単で、他のプラグインについての知識は必要ありません。
あなたがtestngを使用している場合あなたは自分の親ポンポン(一つだけの場所)で定義することができます。
<profile>
<id>normal</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludedGroups>integration</excludedGroups>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>integration</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includedGroups>integration</includedGroups>
</configuration>
</plugin>
</plugins>
</build>
</profile>
注釈すべての統合テストをすることによって:
@Test(groups="integration")
あなたはJUnitのを使用している場合は、Category
を見ます
通常テストを実行する:mvn clean install
統合テストby mvn -Pintegration clean install