<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>com.indeed</groupId>
        <artifactId>common-parent</artifactId>
        <version>20</version>
    </parent>

    <prerequisites>
        <maven>3.3.9</maven>
    </prerequisites>

    <groupId>com.indeed</groupId>
    <artifactId>proctor-parent</artifactId>
    <!--This version is not used in latest release. See https://mvnrepository.com/artifact/com.indeed/proctor-parent -->
    <version>1.9.79</version>
    <packaging>pom</packaging>
    <url>https://github.com/indeedeng</url>

    <developers>
        <developer>
            <id>IndeedEng</id>
            <name>Indeed Engineering</name>
            <url>https://github.com/indeedeng</url>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <url>https://github.com/indeedeng/proctor</url>
        <connection>scm:git:https://github.com/indeedeng/proctor.git</connection>
        <developerConnection>scm:git:git@github.com:indeedeng/proctor.git</developerConnection>
    </scm>

    <modules>
        <module>coverage-report</module>
        <module>proctor-ant-plugin</module>
        <module>proctor-builder</module>
        <module>proctor-codegen</module>
        <module>proctor-codegen-test</module>
        <module>proctor-common</module>
        <module>proctor-consumer</module>
        <module>proctor-webapp-library</module>
        <module>proctor-webapp</module>
        <module>proctor-pipet</module>
        <module>proctor-maven-plugin</module>
        <module>proctor-store</module>
        <module>proctor-store-git</module>
        <module>proctor-store-svn</module>
        <module>proctor-tomcat-deps</module>
        <module>proctor-tomcat-deps-provided</module>
    </modules>

    <properties>
        <java.version>1.8</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <autoVersionSubmodules>true</autoVersionSubmodules>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <indeed-util.version>1.0.49-1cfb888</indeed-util.version>
        <apache-commons-pool2.version>2.2</apache-commons-pool2.version>
        <commons-lang3.version>3.3.2</commons-lang3.version>
        <commons-io.version>2.4</commons-io.version>
        <!--
        the versions defined in javadev
        -->
        <spring.version>4.3.18.RELEASE</spring.version>
        <google-guava.version>19.0</google-guava.version>
        <log4j2.version>2.17.1</log4j2.version>
        <jackson.core.version>2.9.10</jackson.core.version>
        <tomcat-api7.version>7.0.8</tomcat-api7.version>
        <ant.version>1.8.2</ant.version>
        <svnkit.version>1.8.5</svnkit.version>
        <jsr-305.version>1.3.9</jsr-305.version>
        <junit.version>4.12</junit.version>
        <mockito.version>2.28.2</mockito.version>
        <easymock.version>2.4</easymock.version>
        <assertj.version>3.6.2</assertj.version>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <!-- argline required for jacoco plugin -->
                    <argLine>${argLine} -Xmx1024m</argLine>
                </configuration>
            </plugin>
            <plugin>
                <!-- Automatically creates target/jacoco.exec when running mvn test.
                     To create html report, run mvn jacoco:report-aggregate
                -->
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.3</version>
                <configuration>
                    <output>file</output>
                    <append>true</append>
                </configuration>
                <executions>
                    <execution>
                        <id>jacoco-initialize</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.0.0</version>
                <configuration>
                    <additionalparam>-Xdoclint:none</additionalparam>
                    <additionalOptions>-Xdoclint:none</additionalOptions>
                    <additionalJOption>-Xdoclint:none</additionalJOption>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>2.6</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.8.0</version>
                    <configuration>
                        <showDeprecation>true</showDeprecation>
                        <showWarnings>true</showWarnings>
                        <compilerArgument>-Xlint:all</compilerArgument>
                        <compilerArgument>-Xlint:-processing</compilerArgument>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>3.0.0-M1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>3.0.0-M1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.1.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>3.7.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.0.0-M3</version>
                </plugin>
                <plugin>
                    <!--
                        Tomcat7 el library has better performance than Tomcat8 one.
                        To avoid the performance issue on Tomcat8, proctor-common and related libraries should be
                        independent of the version of the apache-el of the running environment.
                        This shaded el library doesn't allow to use Tomcat8 el syntax like assign, concat, arrows, maps.

                        The current approach shades the classes in all proctor packages during packaging,
                        which sadly causes jvm crashes when running mvn test twice without clean.
                        Shading one module only in a maven multi-module project does not work cleanly.
                        The clean way to use the shade plugin would be to package javax-el7 in a separate maven project,
                        and use it as a library.
                        Since maven has no incremental testing anyway, running mvn clean test is ok as workaround.
                    -->
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>3.2.1</version>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>shade</goal>
                            </goals>
                            <configuration>
                                <artifactSet>
                                    <includes>
                                        <include>org.apache.tomcat:*</include>
                                    </includes>
                                </artifactSet>
                                <filters>
                                    <filter>
                                        <artifact>org.apache.tomcat</artifact>
                                        <includes>
                                            <include>org/apache/el/**</include>
                                            <include>javax/el/**</include>
                                        </includes>
                                    </filter>
                                </filters>
                                <relocations>
                                    <relocation>
                                        <pattern>javax.el.</pattern>
                                        <shadedPattern>com.indeed.shaded.javax.el7.</shadedPattern>
                                    </relocation>
                                    <relocation>
                                        <pattern>org.apache.el.</pattern>
                                        <shadedPattern>com.indeed.shaded.org.apache.el7.</shadedPattern>
                                    </relocation>
                                </relocations>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <!-- Dependencies shared by all subprojects -->
    <dependencies>

        <!--Common Dependencies-->
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-api</artifactId>
            <version>${log4j2.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>${log4j2.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>${commons-lang3.version}</version>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>${google-guava.version}</version>
        </dependency>

        <!--Test Dependencies-->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>${assertj.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.easymock</groupId>
            <artifactId>easymock</artifactId>
            <version>${easymock.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.easymock</groupId>
            <artifactId>easymockclassextension</artifactId>
            <version>${easymock.version}</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <!-- Does not add dependencies to children, but provides version, scope and exclusions to any child including these -->
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${jackson.core.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-core</artifactId>
                <version>${jackson.core.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-annotations</artifactId>
                <version>${jackson.core.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.code.findbugs</groupId>
                <artifactId>jsr305</artifactId>
                <version>${jsr-305.version}</version>
            </dependency>
            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>javax.servlet-api</artifactId>
                <!-- Tomcat 7 requires servlet 3.0 -->
                <version>3.0.1</version>
                <!-- Let the container/application provide the servlet-api, to avoid conflicts -->
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>${commons-io.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-beans</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-jdbc</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-web</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-webmvc</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-test</artifactId>
                <version>${spring.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.ant</groupId>
                <artifactId>ant</artifactId>
                <version>${ant.version}</version>
            </dependency>
            <dependency>
                <groupId>org.tmatesoft.svnkit</groupId>
                <artifactId>svnkit</artifactId>
                <version>${svnkit.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.tomcat</groupId>
                <artifactId>tomcat-el-api</artifactId>
                <version>${tomcat-api7.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.tomcat</groupId>
                <artifactId>tomcat-jasper-el</artifactId>
                <version>${tomcat-api7.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.tomcat</groupId>
                <artifactId>tomcat-jsp-api</artifactId>
                <version>${tomcat-api7.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.tomcat</groupId>
                <artifactId>tomcat-servlet-api</artifactId>
                <version>${tomcat-api7.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>


</project>
