All Downloads are FREE. Search and download functionalities are using the official Maven repository.

archetype-resources.pom.xml Maven / Gradle / Ivy

Go to download

Sample Maven archetype showing how to configure Cargo and Maven to run functional tests directly from a webapp with datasource. Cargo will be used to configure the datasource on the container.

The newest version!
<?xml version="1.0" encoding="UTF-8"?>

<!--
  Codehaus Cargo, copyright 2004-2011 Vincent Massol, 2012-2024 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>
  <groupId>\${groupId}</groupId>
  <artifactId>\${artifactId}</artifactId>
  <version>\${version}</version>
  <packaging>war</packaging>
  <name>Maven Webapp</name>

  <dependencies>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>2.4</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <version>${cargo.archetypes-junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.derby</groupId>
      <artifactId>derby</artifactId>
      <version>${cargo.derby.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <servlet.port>8080</servlet.port>
  </properties>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${maven.compiler-plugin.version}</version>
          <configuration>
            <source>${maven.compiler-java.version}</source>
            <target>${maven.compiler-java.version}</target>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>${maven.failsafe-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-war-plugin</artifactId>
          <version>${maven.war-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.cargo</groupId>
          <artifactId>cargo-maven3-plugin</artifactId>
          <version>${project.version}</version>
          <configuration>
            <container>
              <dependencies>
                <dependency>
                  <groupId>org.apache.derby</groupId>
                  <artifactId>derby</artifactId>
                </dependency>
              </dependencies>
              <systemProperties>
                <derby.system.home>\${project.build.directory}/derby</derby.system.home>
              </systemProperties>
            </container>
            <configuration>
              <properties>
                <cargo.servlet.port>\${servlet.port}</cargo.servlet.port>
              </properties>
              <datasources>
                <datasource>
                  <driverClass>org.apache.derby.jdbc.EmbeddedDriver</driverClass>
                  <url>jdbc:derby:derbyDB;create=true</url>
                  <jndiName>jdbc/CargoDS</jndiName>
                  <username>APP</username>
                  <password>nonemptypassword</password>
                </datasource>
              </datasources>
            </configuration>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <executions>
          <execution>
            <id>perform-it</id>
            <goals>
              <goal>integration-test</goal>
            </goals>
            <configuration>
              <systemPropertyVariables>
                <servlet.port>\${servlet.port}</servlet.port>
              </systemPropertyVariables>
            </configuration>
          </execution>
          <execution>
            <id>verify-it</id>
            <goals>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.cargo</groupId>
        <artifactId>cargo-maven3-plugin</artifactId>
        <executions>
          <execution>
            <id>start-cargo</id>
            <phase>pre-integration-test</phase>
            <goals>
              <goal>start</goal>
            </goals>
          </execution>
          <execution>
            <id>stop-cargo</id>
            <phase>post-integration-test</phase>
            <goals>
              <goal>stop</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>jetty9x</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.codehaus.cargo</groupId>
              <artifactId>cargo-maven3-plugin</artifactId>
              <configuration>
                <container>
                  <containerId>jetty9x</containerId>
                  <artifactInstaller>
                    <groupId>org.eclipse.jetty</groupId>
                    <artifactId>jetty-distribution</artifactId>
                    <version>9.4.56.v20240826</version>
                  </artifactInstaller>
                </container>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
    <profile>
      <id>tomcat9x</id>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.codehaus.cargo</groupId>
              <artifactId>cargo-maven3-plugin</artifactId>
              <configuration>
                <container>
                  <containerId>tomcat9x</containerId>
                  <artifactInstaller>
                    <groupId>org.apache.tomcat</groupId>
                    <artifactId>tomcat</artifactId>
                    <version>9.0.98</version>
                  </artifactInstaller>
                </container>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
    <profile>
      <id>jboss71x</id>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.codehaus.cargo</groupId>
              <artifactId>cargo-maven3-plugin</artifactId>
              <configuration>
                <container>
                  <containerId>jboss71x</containerId>
                  <artifactInstaller>
                    <groupId>org.jboss.as</groupId>
                    <artifactId>jboss-as-dist</artifactId>
                    <version>7.1.1.Final</version>
                  </artifactInstaller>
                </container>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
    <profile>
      <id>jonas5x</id>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.codehaus.cargo</groupId>
              <artifactId>cargo-maven3-plugin</artifactId>
              <configuration>
                <container>
                  <containerId>jonas5x</containerId>
                  <artifactInstaller>
                    <groupId>org.ow2.jonas.assemblies.profiles.legacy</groupId>
                    <artifactId>jonas-full</artifactId>
                    <version>5.3.0</version>
                    <classifier>bin</classifier>
                  </artifactInstaller>
                </container>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
    <profile>
      <id>glassfish5x</id>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.codehaus.cargo</groupId>
              <artifactId>cargo-maven3-plugin</artifactId>
              <configuration>
                <container>
                  <containerId>glassfish5x</containerId>
                  <artifactInstaller>
                    <groupId>org.glassfish.main.distributions</groupId>
                    <artifactId>glassfish</artifactId>
                    <version>5.1.0</version>
                  </artifactInstaller>
                  <dependencies>
                    <!--
                      Remove the org.apache.derby dependency since GlassFish 5.x is already
                      shipped with Derby, and adding the dependency twice results in a
                      java.lang.SecurityException: sealing violation: package org.apache.derby.
                      -->
                      <dependency>
                        <groupId>org.apache.derby</groupId>
                        <artifactId>derby</artifactId>
                        <classpath>none</classpath>
                      </dependency>
                  </dependencies>
                </container>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
    <profile>
      <id>geronimo3x</id>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.codehaus.cargo</groupId>
              <artifactId>cargo-maven3-plugin</artifactId>
              <configuration>
                <container>
                  <containerId>geronimo3x</containerId>
                  <artifactInstaller>
                    <groupId>org.apache.geronimo.assemblies</groupId>
                    <artifactId>geronimo-tomcat7-javaee6</artifactId>
                    <version>3.0.1</version>
                    <classifier>bin</classifier>
                  </artifactInstaller>
                </container>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
    <profile>
      <id>wildfly21x</id>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.codehaus.cargo</groupId>
              <artifactId>cargo-maven3-plugin</artifactId>
              <configuration>
                <container>
                  <containerId>wildfly21x</containerId>
                  <artifactInstaller>
                    <groupId>org.wildfly</groupId>
                    <artifactId>wildfly-dist</artifactId>
                    <version>21.0.2.Final</version>
                  </artifactInstaller>
                </container>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
  </profiles>
</project>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy