<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements.  See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership.  The ASF licenses this file
~ to you 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:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <artifactId>tomcat-maven-plugin</artifactId>
        <groupId>org.opoo.maven</groupId>
        <version>3.0.0</version>
    </parent>
    <artifactId>tomcat9-maven-plugin</artifactId>
    <packaging>maven-plugin</packaging>
    <name>Apache Tomcat Maven Plugin :: Tomcat 9.x</name>
    <description>The Tomcat Maven Plugin provides goals to manipulate WAR projects within the Tomcat 8.x servlet
        container.
    </description>

    <properties>
        <managerWebAppPath>${basedir}/target/</managerWebAppPath>
        <warTestPath>${basedir}/src/test/simple-war-project-1.0-SNAPSHOT.war</warTestPath>
        <keystoreTestPath>${basedir}/src/test/keystore</keystoreTestPath>
        <tomcat9Version>9.0.46</tomcat9Version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-core</artifactId>
            <version>${tomcat9Version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>tomcat-util</artifactId>
            <version>${tomcat9Version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>tomcat-coyote</artifactId>
            <version>${tomcat9Version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>tomcat-api</artifactId>
            <version>${tomcat9Version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>tomcat-jdbc</artifactId>
            <version>${tomcat9Version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>tomcat-dbcp</artifactId>
            <version>${tomcat9Version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>tomcat-servlet-api</artifactId>
            <version>${tomcat9Version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>tomcat-jsp-api</artifactId>
            <version>${tomcat9Version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>tomcat-jasper</artifactId>
            <version>${tomcat9Version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>tomcat-jasper-el</artifactId>
            <version>${tomcat9Version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>tomcat-el-api</artifactId>
            <version>${tomcat9Version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>tomcat-catalina</artifactId>
            <version>${tomcat9Version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>tomcat-tribes</artifactId>
            <version>${tomcat9Version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>tomcat-catalina-ha</artifactId>
            <version>${tomcat9Version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>tomcat-annotations-api</artifactId>
            <version>${tomcat9Version}</version>
        </dependency>

        <!-- tomcat i18n too ?? -->

        <!-- not sure we need that -->
        <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>tomcat-juli</artifactId>
            <version>${tomcat9Version}</version>
        </dependency>

        <!--
                <dependency>
                    <groupId>org.apache.tomcat.embed</groupId>
                    <artifactId>tomcat-embed-logging-juli</artifactId>
                    <version>${tomcat9Version}</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.tomcat.embed</groupId>
                    <artifactId>tomcat-embed-logging-log4j</artifactId>
                    <version>${tomcat9Version}</version>
                </dependency>
        -->
        <dependency>
            <groupId>org.eclipse.jdt.core.compiler</groupId>
            <artifactId>ecj</artifactId>
        </dependency>

        <!-- end tomcat dependencies -->


        <dependency>
            <groupId>org.opoo.maven</groupId>
            <artifactId>common-tomcat-maven-plugin</artifactId>
        </dependency>
        <dependency>
            <groupId>org.opoo.maven</groupId>
            <artifactId>tomcat9-war-runner</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-annotations</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-archiver</artifactId>
        </dependency>
        <dependency>
            <groupId>org.codehaus.plexus</groupId>
            <artifactId>plexus-classworlds</artifactId>
        </dependency>

        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
        </dependency>

        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-compress</artifactId>
        </dependency>

        <dependency>
            <groupId>org.codehaus.plexus</groupId>
            <artifactId>plexus-archiver</artifactId>
        </dependency>

        <dependency>
            <groupId>org.codehaus.plexus</groupId>
            <artifactId>plexus-utils</artifactId>
        </dependency>

        <dependency>
            <groupId>org.apache.maven.shared</groupId>
            <artifactId>maven-filtering</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>nekohtml</groupId>
                    <artifactId>xercesMinimal</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-slf4j-impl</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
                <filtering>true</filtering>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>**/**IT*</exclude>
                    </excludes>
                    <systemPropertyVariables>
                        <java.io.tmpdir>${project.build.directory}</java.io.tmpdir>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>run-its</id>

            <build>
                <plugins>
                    <!-- For integration tests the plugin needs to be installed before
                    the integration tests are executed -->
                    <!--
                    <plugin>
                      <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-install-plugin</artifactId>
                      <executions>
                        <execution>
                          <id>install-plugin-pre-integration-test</id>
                          <phase>pre-integration-test</phase>
                          <goals>
                            <goal>install</goal>
                          </goals>
                        </execution>
                      </executions>
                    </plugin>
                    <plugin>
                      <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-invoker-plugin</artifactId>
                      <configuration>
                        <projectsDirectory>src/it</projectsDirectory>
                        <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
                        <pomIncludes>
                          <pomInclude>*/pom.xml</pomInclude>
                        </pomIncludes>
                        <postBuildHookScript>verify</postBuildHookScript>
                        <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
                        <goals>
                          <goal>clean</goal>
                          <goal>package</goal>
                        </goals>
                        <settingsFile>src/it/settings.xml</settingsFile>
                        <debug>true</debug>
                      </configuration>
                      <executions>
                        <execution>
                          <id>integration-tests-invoker</id>
                          <goals>
                            <goal>run</goal>
                          </goals>
                        </execution>
                      </executions>
                    </plugin>
                    -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>integration-test</id>
                                <goals>
                                    <goal>integration-test</goal>
                                </goals>
                                <configuration>
                                    <systemPropertyVariables>
                                        <mojoVersion>${project.version}</mojoVersion>
                                        <verifier.maven.debug>${verifier.maven.debug}</verifier.maven.debug>
                                        <verifier.debugJvm>${verifier.debugJvm}</verifier.debugJvm>
                                        <its.http.port>${its.http.port}</its.http.port>
                                        <its.https.port>${its.https.port}</its.https.port>
                                        <its.ajp.port>${its.ajp.port}</its.ajp.port>
                                        <java.io.tmpdir>${project.build.directory}</java.io.tmpdir>
                                    </systemPropertyVariables>
                                    <redirectTestOutputToFile>false</redirectTestOutputToFile>
                                    <useFile>false</useFile>
                                </configuration>
                            </execution>
                            <execution>
                                <id>verify</id>
                                <goals>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
