<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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.github.cchacin</groupId>
    <artifactId>basepom</artifactId>
    <packaging>pom</packaging>
    <version>0.1.8</version>

    <parent>
        <groupId>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>9</version>
        <!--Fixes broken Maven 3 warning-->
        <relativePath />
    </parent>

    <name>Base POM Java EE</name>
    <description>Base POM for Java EE Projects</description>
    <inceptionYear>2014</inceptionYear>
    <url>https://github.com/cchacin/base-pom</url>

    <scm>
        <url>scm:git:git@github.com:cchacin/base-pom.git</url>
        <connection>scm:git:git@github.com:cchacin/base-pom.git</connection>
        <developerConnection>scm:git:git@github.com:cchacin/base-pom.git</developerConnection>
        <tag>v0.1.8</tag>
    </scm>

    <prerequisites>
        <maven>${maven.version}</maven>
    </prerequisites>

    <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>

    <developers>
        <developer>
            <id>cchacin</id>
            <name>Carlos Chacin</name>
            <email>cchacin@gmail.com</email>
            <roles>
                <role>Developer</role>
            </roles>
            <timezone>-4</timezone>
        </developer>
    </developers>

    <distributionManagement>
      <snapshotRepository>
        <id>ossrh</id>
        <url>https://oss.sonatype.org/content/repositories/snapshots</url>
      </snapshotRepository>
      <repository>
        <id>ossrh</id>
        <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
      </repository>
    </distributionManagement>

    <properties>
        <!-- Version strings -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.inputEncoding>UTF-8</project.reporting.inputEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <maven.compiler.target>1.7</maven.compiler.target>
        <maven.compiler.source>1.7</maven.compiler.source>

        <maven.version>3.0.1</maven.version>

        <checkstyle.version>2.13</checkstyle.version>
        <findbugs.version>3.0.0</findbugs.version>
        <git-commit-id.version>2.1.10</git-commit-id.version>
        <pmd.version>3.3</pmd.version>
        <release.version>2.5.1</release.version>
        <gpg.version>1.6</gpg.version>
        <scm.version>1.9.1</scm.version>
        <resources.version>2.7</resources.version>
        <source.version>2.4</source.version>
        <javadoc.version>2.10.1</javadoc.version>
        <war.version>2.6</war.version>
        <surefire.version>2.18.1</surefire.version>
        <failsafe.version>2.18.1</failsafe.version>
        <license.version>2.9</license.version>
        <compiler.version>3.3</compiler.version>
        <cobertura.version>2.7</cobertura.version>
    </properties>

    <build>

        <finalName>${project.artifactId}-${project.version}</finalName>

        <resources>
            <resource>
                <directory>${basedir}/src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>

        <testResources>
            <testResource>
                <directory>${basedir}/src/test/resources</directory>
                <filtering>true</filtering>
            </testResource>
        </testResources>

        <pluginManagement>
            <plugins>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${compiler.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${source.version}</version>
                    <executions>
                        <execution>
                            <id>sources</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${javadoc.version}</version>
                    <executions>
                        <execution>
                            <id>javadoc</id>
                            <phase>package</phase>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <!-- Resources plugin -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>${resources.version}</version>
                    <configuration>
                        <encoding>${project.build.sourceEncoding}</encoding>
                    </configuration>
                </plugin>

                <!-- Surefire plugin -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${surefire.version}</version>
                    <configuration>
                        <forkCount>2.5C</forkCount>
                        <reuseForks>false</reuseForks>
                        <useSystemClassLoader>false</useSystemClassLoader>
                        <failIfNoTests>false</failIfNoTests>
                        <systemPropertyVariables>
                            <buildDirectory>${project.build.directory}</buildDirectory>
                        </systemPropertyVariables>
                        <excludes>
                            <exclude>**/*ITest.java</exclude>
                            <exclude>**/*ITests.java</exclude>
                        </excludes>
                    </configuration>
                    <executions>
                        <execution>
                            <id>unit-tests</id>
                            <phase>test</phase>
                            <goals>
                                <goal>test</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <!-- Failsafe plugin -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>${failsafe.version}</version>
                    <configuration>
                        <includes>
                            <include>**/*ITest.java</include>
                            <include>**/*ITests.java</include>
                        </includes>
                        <useSystemClassLoader>false</useSystemClassLoader>
                    </configuration>
                    <executions>
                        <execution>
                            <id>failsafe-integration-test</id>
                            <goals>
                                <goal>integration-test</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>failsafe-verify</id>
                            <goals>
                                <goal>verify</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <!-- War plugin -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>${war.version}</version>
                    <configuration>
                        <failOnMissingWebXml>false</failOnMissingWebXml>
                        <webResources>
                            <resource>
                                <directory>${basedir}/src/main/webapp/WEB-INF</directory>
                                <filtering>true</filtering>
                                <targetPath>WEB-INF</targetPath>
                            </resource>
                        </webResources>
                    </configuration>
                </plugin>

                <!-- Eclipse Formatter Plugin -->
                <plugin>
                    <groupId>com.googlecode.maven-java-formatter-plugin</groupId>
                    <artifactId>maven-java-formatter-plugin</artifactId>
                    <version>0.4</version>
                    <configuration>
                        <configFile>${basedir}/code-styles/google-code-style.xml</configFile>
                        <compilerCompliance>${maven.compiler.target}</compilerCompliance>
                        <compilerSource>${maven.compiler.source}</compilerSource>
                        <compilerTargetPlatform>${maven.compiler.target}</compilerTargetPlatform>
                    </configuration>
                    <executions>
                        <execution>
                            <id>format</id>
                            <phase>compile</phase>
                            <goals>
                                <goal>format</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <!-- Cobertura -->
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>cobertura-maven-plugin</artifactId>
                    <version>${cobertura.version}</version>
                    <configuration>
                        <check>true</check>
                        <format>xml</format>
                        <aggregate>true</aggregate>
                    </configuration>
                </plugin>

                <!-- JaCoCo Plugin -->
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>0.7.4.201502262128</version>
                    <executions>
                        <execution>
                            <id>jacoco-pre-unit-test</id>
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                            <configuration>
                                <destFile>${project.build.directory}/coverage-reports/jacoco.exec</destFile>
                                <propertyName>surefireArgLine</propertyName>
                            </configuration>
                        </execution>
                        <execution>
                            <id>jacoco-post-unit-test</id>
                            <phase>test</phase>
                            <goals>
                                <goal>report</goal>
                            </goals>
                            <configuration>
                                <dataFile>${project.build.directory}/coverage-reports/jacoco.exec</dataFile>
                                <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>${license.version}</version>
                    <configuration>
                        <basedir>${basedir}</basedir>
                        <header>${basedir}/header.txt</header>
                        <properties>
                            <owner>Carlos Chacin</owner>
                            <email>cchacin@gmail.com</email>
                        </properties>
                        <quiet>false</quiet>
                        <failIfMissing>true</failIfMissing>
                        <aggregate>false</aggregate>
                        <includes>
                            <include>src/main/java/</include>
                            <include>src/test/java/</include>
                        </includes>
                        <excludes>
                            <exclude>**/README</exclude>
                            <exclude>src/test/resources/**</exclude>
                            <exclude>src/main/resources/**</exclude>
                        </excludes>
                        <useDefaultExcludes>true</useDefaultExcludes>
                        <mapping>
                            <java>JAVADOC_STYLE</java>
                        </mapping>
                        <strictCheck>true</strictCheck>
                        <useDefaultMapping>true</useDefaultMapping>
                        <encoding>${project.build.sourceEncoding}</encoding>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-pmd-plugin</artifactId>
                    <version>${pmd.version}</version>
                    <configuration>
                        <sourceEncoding>${project.build.sourceEncoding}</sourceEncoding>
                        <targetJdk>${maven.compiler.target}</targetJdk>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>verify</phase>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>${release.version}</version>
                    <configuration>
                        <tagNameFormat>v@{project.version}</tagNameFormat>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>findbugs-maven-plugin</artifactId>
                    <version>${findbugs.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>${checkstyle.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>${gpg.version}</version>
                    <configuration>
                        <useAgent>true</useAgent>
                    </configuration>
                    <executions>
                        <execution>
                            <id>sign-artifacts</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

            </plugins>
        </pluginManagement>

    </build>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-release-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
