cargo-sample-maven2-tomcat8x-embedded-test
Used in:
components
- OverviewOverview
- VersionsVersions
- DependentsDependents
- DependenciesDependencies
<dependency> <groupId>org.codehaus.cargo</groupId> <artifactId>cargo-sample-maven2-tomcat8x-embedded-test</artifactId> <version>1.8.5</version> </dependency>
<?xml version="1.0" encoding="UTF-8"?> <!-- Codehaus CARGO, copyright 2004-2011 Vincent Massol, 2012-2021 Ali Tokmen. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <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"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.codehaus.cargo</groupId> <artifactId>cargo-samples-maven2</artifactId> <version>1.8.5</version> </parent> <artifactId>cargo-sample-maven2-tomcat8x-embedded-test</artifactId> <name>Cargo Samples - Maven 2 - Tomcat 8.x embedded container test</name> <packaging>jar</packaging> <description>Sample application that exercises the Cargo Maven 2 / Maven 3 plugin with an embedded Tomcat 8.x container</description> <dependencies> <dependency> <groupId>org.codehaus.cargo</groupId> <artifactId>simple-war</artifactId> <type>war</type> </dependency> </dependencies> <profiles> <profile> <id>run-its</id> <activation> <property> <name>skipTests</name> <value>!true</value> </property> </activation> <build> <!-- Tomcat 7.x has introduced a weird class called TomcatURLStreamHandlerFactory where the singleton has a static "instance" field and a final attribute "registered" which are not always in sync and cause unexpected exceptions. Due to this, we can't execute different versions of Tomcat after version 7.x embedded in the same JVM. As a result, we use the maven-invoker-plugin and execute the Tomcat 8.x embedded tests via Maven in a separate JVM. --> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <executions> <execution> <phase>integration-test</phase> <goals> <goal>copy-resources</goal> </goals> <configuration> <outputDirectory>${project.build.directory}/test-classes</outputDirectory> <resources> <resource> <directory>${basedir}</directory> <includes> <include>src/test/java/**/*.java</include> </includes> </resource> </resources> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-invoker-plugin</artifactId> <configuration> <showErrors>true</showErrors> <streamLogs>true</streamLogs> <pom>${project.build.directory}/test-classes/pom.xml</pom> <goals> <goal>clean</goal> <goal>verify</goal> </goals> <properties> <interactiveMode>false</interactiveMode> <groupId>${project.groupId}</groupId> <artifactId>${project.artifactId}-invoker</artifactId> <version>${project.version}</version> <cargo.samples.servlet.port>${cargo.samples.servlet.port}</cargo.samples.servlet.port> <cargo.samples.rmi.port>${cargo.samples.rmi.port}</cargo.samples.rmi.port> <cargo.version>${project.version}</cargo.version> </properties> </configuration> <executions> <execution> <id>integration-test</id> <goals> <goal>verify</goal> <goal>run</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </profile> </profiles> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <skip>true</skip> </configuration> </plugin> </plugins> </build> </project>