</execution>
</executions>
</plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>dependency-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>unzip-archiva-webapp</id>
- <phase>generate-resources</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>${project.groupId}</groupId>
- <artifactId>archiva-webapp</artifactId>
- <version>${project.version}</version>
- <type>war</type>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${project.build.directory}/${container.name}conf/webapps/archiva</outputDirectory>
- </configuration>
- </execution>
- <execution>
- <id>prepare-provided-dependencies</id>
- <phase>generate-resources</phase>
- <goals>
- <goal>copy-dependencies</goal>
- </goals>
- <configuration>
- <includeGroupIds>org.apache.derby,javax.mail,javax.activation</includeGroupIds>
- <overWriteReleases>false</overWriteReleases>
- <overWriteSnapshots>true</overWriteSnapshots>
- <excludeTransitive>false</excludeTransitive>
- <outputDirectory>${project.build.directory}/providedDependencies</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <phase>generate-resources</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <tasks>
- <copy todir="${project.build.directory}/appserver-base">
- <fileset dir="src/test/it-resources/appserver-base" />
- </copy>
- <copy todir="${project.build.directory}/repository">
- <fileset dir="src/test/it-resources/repository" />
- </copy>
- <copy todir="${project.build.directory}/index">
- <fileset dir="src/test/it-resources/index" />
- </copy>
- <copy todir="${project.build.directory}/snapshots">
- <fileset dir="src/test/it-resources/snapshots" />
- </copy>
- <copy todir="${project.build.directory}/projects">
- <fileset dir="src/test/it-resources/projects" />
- </copy>
- <copy todir="${project.build.directory}/local-repo">
- <fileset dir="src/test/it-resources/local-repo" />
- </copy>
- </tasks>
- </configuration>
- </execution>
- <execution>
- <id>copy-container-conf</id>
- <phase>package</phase>
- <configuration>
- <tasks>
- <copy todir="${project.build.directory}/${container.name}conf">
- <fileset dir="src/test/${container.name}" />
- </copy>
- <copy
- todir="${project.build.directory}/installs/${container.name}/apache-tomcat-5.5.26/apache-tomcat-5.5.26/common/lib">
- <fileset dir="${project.build.directory}/providedDependencies">
- <include name="**/*.jar" />
- </fileset>
- </copy>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- <execution>
- <id>check-archiva-loaded</id>
- <phase>integration-test</phase>
- <configuration>
- <tasks>
- <get src="http://localhost:9696/archiva/" dest="${project.build.directory}/index.html" />
- <delete file="${project.build.directory}/index.html" />
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<background>true</background>
</configuration>
</plugin>
- <plugin>
- <groupId>org.codehaus.cargo</groupId>
- <artifactId>cargo-maven2-plugin</artifactId>
- <version>1.0</version>
- <executions>
- <execution>
- <id>start-container</id>
- <phase>pre-integration-test</phase>
- <goals>
- <goal>start</goal>
- </goals>
- </execution>
- <execution>
- <id>stop-container</id>
- <phase>post-integration-test</phase>
- <goals>
- <goal>stop</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <wait>false</wait>
- <container>
- <containerId>${container.name}</containerId>
- <zipUrlInstaller>
- <url>${container.url}</url>
- <installDir>${project.build.directory}/installs/${container.name}</installDir>
- </zipUrlInstaller>
- <log>${project.build.directory}/logs/${container.name}.log</log>
- <output>${project.build.directory}/logs/${container.name}.out</output>
- <timeout>600000</timeout>
- <systemProperties>
- <appserver.base>${project.build.directory}/appserver-base</appserver.base>
- <appserver.home>${project.build.directory}/appserver-base</appserver.home>
- </systemProperties>
- </container>
- <configuration>
- <home>${project.build.directory}/${container.name}conf</home>
- <type>existing</type>
- <properties>
- <cargo.servlet.port>9696</cargo.servlet.port>
- </properties>
- </configuration>
- </configuration>
- </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugins>
</build>
<profiles>
+ <profile>
+ <id>create-container</id>
+ <activation>
+ <property>
+ <name>!container</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>dependency-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unzip-archiva-webapp</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>archiva-webapp</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ </artifactItem>
+ </artifactItems>
+ <outputDirectory>${project.build.directory}/${container.name}conf/webapps/archiva</outputDirectory>
+ </configuration>
+ </execution>
+ <execution>
+ <id>prepare-provided-dependencies</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <configuration>
+ <includeGroupIds>org.apache.derby,javax.mail,javax.activation</includeGroupIds>
+ <overWriteReleases>false</overWriteReleases>
+ <overWriteSnapshots>true</overWriteSnapshots>
+ <excludeTransitive>false</excludeTransitive>
+ <outputDirectory>${project.build.directory}/providedDependencies</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <copy todir="${project.build.directory}/appserver-base">
+ <fileset dir="src/test/it-resources/appserver-base" />
+ </copy>
+ <copy todir="${project.build.directory}/repository">
+ <fileset dir="src/test/it-resources/repository" />
+ </copy>
+ <copy todir="${project.build.directory}/index">
+ <fileset dir="src/test/it-resources/index" />
+ </copy>
+ <copy todir="${project.build.directory}/snapshots">
+ <fileset dir="src/test/it-resources/snapshots" />
+ </copy>
+ <copy todir="${project.build.directory}/projects">
+ <fileset dir="src/test/it-resources/projects" />
+ </copy>
+ <copy todir="${project.build.directory}/local-repo">
+ <fileset dir="src/test/it-resources/local-repo" />
+ </copy>
+ </tasks>
+ </configuration>
+ </execution>
+ <execution>
+ <id>copy-container-conf</id>
+ <phase>package</phase>
+ <configuration>
+ <tasks>
+ <copy todir="${project.build.directory}/${container.name}conf">
+ <fileset dir="src/test/${container.name}" />
+ </copy>
+ <copy
+ todir="${project.build.directory}/installs/${container.name}/apache-tomcat-5.5.26/apache-tomcat-5.5.26/common/lib">
+ <fileset dir="${project.build.directory}/providedDependencies">
+ <include name="**/*.jar" />
+ </fileset>
+ </copy>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>check-archiva-loaded</id>
+ <phase>integration-test</phase>
+ <configuration>
+ <tasks>
+ <get src="http://localhost:9696/archiva/" dest="${project.build.directory}/index.html" />
+ <delete file="${project.build.directory}/index.html" />
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <version>1.0</version>
+ <executions>
+ <execution>
+ <id>start-container</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>start</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>stop-container</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <wait>false</wait>
+ <container>
+ <containerId>${container.name}</containerId>
+ <zipUrlInstaller>
+ <url>${container.url}</url>
+ <installDir>${project.build.directory}/installs/${container.name}</installDir>
+ </zipUrlInstaller>
+ <log>${project.build.directory}/logs/${container.name}.log</log>
+ <output>${project.build.directory}/logs/${container.name}.out</output>
+ <timeout>600000</timeout>
+ <systemProperties>
+ <appserver.base>${project.build.directory}/appserver-base</appserver.base>
+ <appserver.home>${project.build.directory}/appserver-base</appserver.home>
+ </systemProperties>
+ </container>
+ <configuration>
+ <home>${project.build.directory}/${container.name}conf</home>
+ <type>existing</type>
+ <properties>
+ <cargo.servlet.port>9696</cargo.servlet.port>
+ </properties>
+ </configuration>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>existing-container</id>
+ <activation>
+ <property>
+ <name>container</name>
+ <value>existing</value>
+ </property>
+ </activation>
+ <!-- edit src/test/resources/testng.properties as needed -->
+ </profile>
<profile>
<id>tomcat5x</id>
<activation>
- <activeByDefault>true</activeByDefault>
+ <property>
+ <name>!container</name>
+ </property>
</activation>
<properties>
<container.name>tomcat5x</container.name>