maven 3.0.4를 사용하고 있습니다. 나는 -Pstage -DrunIT = 사실이-DrunIT = true와 같은 명령 줄에서 매개 변수를 설정할 때 프로필에 대한 maven failsafe 플러그인의 통합 테스트를 실행합니다.
치어 나의 무대 프로필과 같습니다 확인 MVN 예를 에 대한 받는다는 명령을 실행에 몇 가지 속성을 설정하는 경우에만 안전 장치 및 부두 플러그인 실행 (전용 통합 테스트를 실행)하고 싶다.
<profile>
<id>stage</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.16</version>
<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
<execution>
<id>verify</id>
<goals>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.16</version>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.6</version>
</dependency>
<dependency>
<groupId>xmlunit</groupId>
<artifactId>xmlunit</artifactId>
<version>1.5</version>
</dependency>
</dependencies>
<configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
<stopPort>8005</stopPort>
<stopKey>STOP</stopKey>
<contextPath>/</contextPath>
</configuration>
<executions>
<execution>
<id>start-jetty</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run-exploded</goal>
</goals>
<configuration>
<scanIntervalSeconds>0</scanIntervalSeconds>
<daemon>true</daemon>
</configuration>
</execution>
<execution>
<id>stop-jetty</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
왜 프로필이 충분하지 않다? – khmarbaise
새 프로필을 만드는 데는 내 프로젝트에서 많은 재 작업이 필요합니다. 전달 된 인수를 기반으로 플러그인을 활성화하거나 비활성화하는 방법을 찾아야합니다. 어떻게 든 그렇게 할 메이븐 플러그인을 만들 수 있습니까? –