<?xml version="1.0" encoding="UTF-8"?>
<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>de.samply</groupId>
    <artifactId>parent</artifactId>
    <version>11.1.1</version>
    <packaging>pom</packaging>

    <name>maven-parent</name>
    <description>The root maven POM artifact for Samply Projects</description>
    <url>https://github.com/samply/maven-parent</url>

    <organization>
        <name>Samply Community</name>
    </organization>

    <licenses>
        <license>
            <name>The Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Deniz Tas</name>
            <email>d.tas@dkfz-heidelberg.de</email>
            <organization>German Cancer Research Center</organization>
            <organizationUrl>https://www.dkfz.de/en/</organizationUrl>
        </developer>
    </developers>
    
    <scm>
        <connection>scm:git:https://github.com/samply/maven-parent.git</connection>
        <developerConnection>scm:git:https://github.com/samply/maven-parent.git</developerConnection>
        <url>https://github.com/samply/maven-parent</url>
    </scm>

    <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>
        <maven-compiler-plugin.java.version>1.8</maven-compiler-plugin.java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <version.samply.licenses>1.1.0</version.samply.licenses>
        <project.license.file>AGPL-3.txt</project.license.file>
        <currentYear>2017</currentYear> <!-- manual setting -->
        <maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format>
        <currentYearDynamic>${maven.build.timestamp}</currentYearDynamic>

        <version.maven.plugin.annotations>3.6.0</version.maven.plugin.annotations> <!-- ist aktuell -->
        <version.maven.plugin.api>3.6.2</version.maven.plugin.api> <!-- aktuell: 3.6.3 -->
        <version.maven.plugin.assembly>3.1.1</version.maven.plugin.assembly> <!-- aktuell: 3.3.0 -->
        <version.maven.plugin.rat>0.13</version.maven.plugin.rat> <!-- ist aktuell -->
        <version.maven.plugin.dependency>3.1.1</version.maven.plugin.dependency> <!-- aktuell: 3.1.1 -->
        <version.maven.plugin.buildnumber>1.4</version.maven.plugin.buildnumber> <!-- ist aktuell -->
        <version.maven.plugin.war>3.2.3</version.maven.plugin.war> <!-- aktuell: 3.3.1 -->
        <version.maven.plugin.jar>3.1.2</version.maven.plugin.jar> <!-- aktuell: 3.2.0 -->
        <version.maven.plugin.compiler>3.8.1</version.maven.plugin.compiler> <!-- ist aktuell -->
        <version.maven.plugin.surefire>2.22.2</version.maven.plugin.surefire> <!-- ist aktuell / oder 3.0.0-M5 -->
        <version.maven.plugin.source>3.1.0</version.maven.plugin.source> <!-- aktuell: 3.2.1 -->
        <version.maven.plugin.site>3.8.2</version.maven.plugin.site> <!-- aktuell: 3.9.1 -->
        <version.maven.plugin.wagon-webdav-jackrabbit>3.3.3
        </version.maven.plugin.wagon-webdav-jackrabbit>  <!-- aktuell: 3.4.1 -->
        <version.maven.plugin.enforcer>1.4.1</version.maven.plugin.enforcer> <!-- ist aktuell / oder 3.0.0-M3 -->
        <version.maven.plugin.checkstyle>3.1.0</version.maven.plugin.checkstyle> <!-- aktuell: 3.1.1 -->
        <!--
                LEGACY TABLE of dependencies from Heidelberg (*)
                ============================================

                <version.mojarra>2.2.15</version.mojarra>
                <version.myfaces>2.2.12</version.myfaces>
                <version.httpclient>4.5.3</version.httpclient>
                <javax.el-api.version>3.0.0</javax.el-api.version>

                <version.jersey>2.26</version.jersey>
                <version.fasterxml.jackson.jaxrs>2.9.4</version.fasterxml.jackson.jaxrs>
                <version.postgres>42.2.0</version.postgres>

                <version.javax.servlet>3.1.0</version.javax.servlet> &lt;!&ndash;4.0.0&ndash;&gt;
                <version.javax.validation>1.1.0.Final</version.javax.validation> &lt;!&ndash;2.0.0.Final&ndash;&gt;
                <version.javax.mail>1.4.7</version.javax.mail>
                <commons-validator.version>1.6</commons-validator.version>

                <version.commons.codec>1.10</version.commons.codec>
                <version.commons.lang>3.7</version.commons.lang>
                <version.commons.io>2.6</version.commons.io>

                <version.nimbus.jwt>4.41.2</version.nimbus.jwt> &lt;!&ndash;5.1&ndash;&gt;
                <version.gson>2.8.2</version.gson>
                <version.soy>2015-04-10</version.soy>
                <version.jettison>1.3.8</version.jettison>

                <version.guava>24.0-jre</version.guava>
                <version.jaxb>2.3.0</version.jaxb>

                <version.maven.plugin.annotations>3.5</version.maven.plugin.annotations>
                <version.maven.plugin.api>3.5.0</version.maven.plugin.api>

                <version.log4j2>2.9.1</version.log4j2>
                <version.slf4j>1.7.25</version.slf4j>
                <version.slf4j.binding.log4j2>2.9.1</version.slf4j.binding.log4j2>

                <version.hamcrest>2.0.0.0</version.hamcrest>
                <version.easymock>3.5.1</version.easymock>

                <version.tomcat-dbcp>9.0.5</version.tomcat-dbcp>

                <junit-platform.version>1.1.0</junit-platform.version>
                <junit-jupiter.version>5.1.0</junit-jupiter.version>
                <version.junit>4.12</version.junit>

                <commons-csv.version>1.5</commons-csv.version>
                <juel.version>2.2.7</juel.version>

                (*) kept as reference when resolving dependencies of samply projects from Heidelberg
                TODO: Move this information to a suitable wiki
        -->

        <license-maven-plugin.version>2.11</license-maven-plugin.version>  <!-- aktuell: 3.0 oder 4.0-rc2 -->

        <maven-source-plugin.version>2.2.1</maven-source-plugin.version>
        <maven-javadoc-plugin.version>2.9.1</maven-javadoc-plugin.version>
        <maven-gpg-plugin.version>1.5</maven-gpg-plugin.version>
        <nexus-staging-maven-plugin.version>1.6.7</nexus-staging-maven-plugin.version>
    </properties>


    <dependencyManagement>
        <dependencies>
            <!-- Maven Plugin Development -->
            <dependency>
                <groupId>org.apache.maven</groupId>
                <artifactId>maven-plugin-api</artifactId>
                <version>${version.maven.plugin.api}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.maven.plugin-tools</groupId>
                <artifactId>maven-plugin-annotations</artifactId>
                <version>${version.maven.plugin.annotations}</version>
                <scope>provided</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <!-- Those plugins are optional and are not included as dependencies by default -->

            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>2.20.1</version>
                </plugin>

                <plugin>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>${version.maven.plugin.assembly}</version>
                </plugin>

                <!--release audit tool-->
                <plugin>
                    <groupId>org.apache.rat</groupId>
                    <artifactId>apache-rat-plugin</artifactId>
                    <version>${version.maven.plugin.rat}</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>${version.maven.plugin.checkstyle}</version>
                    <configuration>
                        <configLocation>google_checks.xml</configLocation>
                        <encoding>UTF-8</encoding>
                        <consoleOutput>true</consoleOutput>
                        <failsOnError>true</failsOnError>
                        <linkXRef>false</linkXRef>
                        <violationSeverity>warning</violationSeverity>
                    </configuration>
                    <executions>
                        <execution>
                            <id>validate</id>
                            <phase>validate</phase>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>


        <plugins>
            <!-- Includes the build variables like the branch and more as maven variables -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>buildnumber-maven-plugin</artifactId>
                <version>${version.maven.plugin.buildnumber}</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>create</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <doCheck>false</doCheck>
                    <doUpdate>false</doUpdate>
                    <shortRevisionLength>10</shortRevisionLength>
                </configuration>
            </plugin>

            <!-- Includes various variables into the MANIFEST.MF file for war projects -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>${version.maven.plugin.war}</version>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                        </manifest>
                        <manifestEntries>
                            <Build-Timestamp>${maven.build.timestamp}</Build-Timestamp>
                            <SCM-Version>${buildNumber}</SCM-Version>
                            <SCM-Branch>${scmBranch}</SCM-Branch>
                        </manifestEntries>
                    </archive>
                    <scmBranchPropertyName>scmBranch</scmBranchPropertyName>
                </configuration>
            </plugin>

            <!-- Includes various variables into the MANIFEST.MF file for jar projects -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${version.maven.plugin.jar}</version>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                        </manifest>
                        <manifestEntries>
                            <Build-Timestamp>${maven.build.timestamp}</Build-Timestamp>
                            <SCM-Version>${buildNumber}</SCM-Version>
                            <SCM-Branch>${scmBranch}</SCM-Branch>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${version.maven.plugin.compiler}</version>
                <configuration>
                    <source>${maven-compiler-plugin.java.version}</source>
                    <target>${maven-compiler-plugin.java.version}</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${version.maven.plugin.surefire}</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${version.maven.plugin.source}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- This plugin allows to check for snapshot dependencies for release version! -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>${version.maven.plugin.enforcer}</version>
                <configuration>
                    <rules>
                        <requireReleaseDeps>
                            <onlyWhenRelease>true</onlyWhenRelease>
                            <message>No Snapshots Allowed!</message>
                        </requireReleaseDeps>
                    </rules>
                </configuration>
            </plugin>

            <!-- TODO: Decide if plugin from MIG should remain included -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>${version.maven.plugin.dependency}</version>
            </plugin>

            <!-- Allows to check the files in the project for the correct license headers -->
            <!-- TODO: Decide if plugin from HD should remain included -->
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>${license-maven-plugin.version}</version>
                <configuration>
                    <header>licenses/license_header.txt</header>
                    <properties>
                        <h_currentYear>${currentYear}</h_currentYear>
                    </properties>
                    <excludes>
                        <exclude>src/site/**</exclude>
                        <exclude>pom.xml</exclude>
                        <exclude>**/*.episode</exclude>
                        <exclude>**/*.svg</exclude>
                        <exclude>src/test/resources/**</exclude>
                        <exclude>src/main/resources/**</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven-javadoc-plugin.version}</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>${maven-gpg-plugin.version}</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>deploy</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>${nexus-staging-maven-plugin.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>minimal</id>
        </profile>
        <profile>
            <id>all</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                    </plugin>

                    <plugin>
                        <artifactId>maven-assembly-plugin</artifactId>
                    </plugin>

                    <!--release audit tool-->
                    <plugin>
                        <groupId>org.apache.rat</groupId>
                        <artifactId>apache-rat-plugin</artifactId>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-checkstyle-plugin</artifactId>
                        <version>${version.maven.plugin.checkstyle}</version>
                    </plugin>
                </plugins>
            </build>
        </profile>

    </profiles>



</project>
