jetty.project/jetty-cdi/test-cdi-it/pom.xml

205 lines
7.5 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.eclipse.jetty.cdi</groupId>
<artifactId>jetty-cdi-parent</artifactId>
<version>9.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>cdi-webapp-it</artifactId>
<packaging>jar</packaging>
<name>Jetty :: CDI :: Test :: WebApp Integration Tests</name>
<url>http://www.eclipse.org/jetty</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<bundle-symbolic-name>${project.groupId}.cdi.webapp.it</bundle-symbolic-name>
<scripts-dir>${project.basedir}/src/test/scripts</scripts-dir>
<test-base-dir>${project.build.directory}/test-base</test-base-dir>
<test-home-dir>${project.build.directory}/test-home</test-home-dir>
</properties>
<dependencies>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-distribution</artifactId>
<version>${project.version}</version>
<type>zip</type>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.cdi</groupId>
<artifactId>test-cdi-webapp</artifactId>
<version>${project.version}</version>
<type>war</type>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-test-helper</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<!-- DO NOT DEPLOY (or Release) -->
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-apps-for-testing</id>
<phase>process-test-resources</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeArtifactIds>test-cdi-webapp</includeArtifactIds>
<includeScope>runtime</includeScope>
<includeTypes>war</includeTypes>
<overwriteSnapshots>true</overwriteSnapshots>
<overwriteReleases>true</overwriteReleases>
<stripVersion>true</stripVersion>
<outputDirectory>${test-base-dir}/webapps</outputDirectory>
</configuration>
</execution>
<execution>
<id>unpack-jetty-distro</id>
<phase>process-test-resources</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeArtifactIds>jetty-distribution</includeArtifactIds>
<includeScope>runtime</includeScope>
<includeTypes>zip</includeTypes>
<outputAbsoluteArtifactFilename>true</outputAbsoluteArtifactFilename>
<outputDirectory>${test-home-dir}</outputDirectory>
<overWriteSnapshots>true</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>start-jetty</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<property name="jetty.cdi.home" location="${test-home-dir}/jetty-distribution-${project.version}"/>
<property name="jetty.cdi.base" location="${test-base-dir}"/>
<echo>Integration Test : Setup Jetty</echo>
<exec executable="${run.command}"
dir="${scripts-dir}"
spawn="false">
<arg value="${run.command.xtra}"/>
<arg value="${setup.script}"/>
<arg file="${java.home}"/>
<arg file="${jetty.cdi.home}"/>
<arg file="${jetty.cdi.base}"/>
</exec>
<echo>Integration Test : Starting Jetty ...</echo>
<exec executable="${run.command}"
dir="${scripts-dir}"
spawn="true">
<arg value="${run.command.xtra}"/>
<arg value="${start.script}"/>
<arg file="${java.home}"/>
<arg file="${jetty.cdi.home}"/>
<arg file="${jetty.cdi.base}"/>
</exec>
<waitfor maxwait="5" maxwaitunit="second"
checkevery="100" checkeveryunit="millisecond">
<http url="http://localhost:58080/cdi-webapp/"/>
</waitfor>
<echo>Integration Test : Jetty is now available</echo>
</target>
</configuration>
</execution>
<execution>
<id>stop-jetty</id>
<phase>post-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<property name="jetty.cdi.home" location="${test-home-dir}/jetty-distribution-${project.version}"/>
<property name="jetty.cdi.base" location="${test-base-dir}"/>
<echo>Integration Test : Stop Jetty</echo>
<exec executable="${run.command}"
dir="${scripts-dir}"
spawn="false">
<arg value="${run.command.xtra}"/>
<arg value="${stop.script}"/>
<arg file="${java.home}"/>
<arg file="${jetty.cdi.home}"/>
<arg file="${jetty.cdi.base}"/>
</exec>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>it-windows</id>
<activation>
<os>
<family>Windows</family>
</os>
</activation>
<properties>
<run.command>cmd</run.command>
<run.command.xtra>/c</run.command.xtra>
<start.script>start-jetty.bat</start.script>
<stop.script>stop-jetty.bat</stop.script>
</properties>
</profile>
<profile>
<id>it-unix</id>
<activation>
<os>
<family>unix</family>
</os>
</activation>
<properties>
<run.command>sh</run.command>
<run.command.xtra>--</run.command.xtra>
<setup.script>setup-jetty.sh</setup.script>
<start.script>start-jetty.sh</start.script>
<stop.script>stop-jetty.sh</stop.script>
</properties>
</profile>
</profiles>
</project>