<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>
    <prerequisites>
        <maven>3.0.5</maven>
    </prerequisites>

    <groupId>ml.alternet</groupId>
    <artifactId>alternet-libs</artifactId>
    <version>1.0</version>
    <packaging>pom</packaging>
    <name>Alternet Libs</name>
    <description>Alternet Libs : a bunch of Java libraries</description>
    <url>http://alternet.ml/alternet-libs/</url>

    <properties>
        <site.deploy.dir>${project.build.directory}/staging/</site.deploy.dir>
        <github.global.server>alternet.github.io</github.global.server><!-- ref to settings.xml -->
        <github.local.dir>${basedir}/../../alternet/alternet.github.io</github.local.dir>
        <gpg.executable>gpg2</gpg.executable>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>1.8</java.version>

        <version.assertj-core>3.9.1</version.assertj-core>
        <version.checkstyle>8.8</version.checkstyle>
        <version.github.site-maven-plugin>0.12</version.github.site-maven-plugin>
        <!-- https://github.com/github/maven-plugins/issues/69 -->
        <version.maven-checkstyle-plugin>3.0.0</version.maven-checkstyle-plugin>
        <version.maven-compiler-plugin>3.7.0</version.maven-compiler-plugin><!-- alternet-tools and alternet-parsing FAIL with 3.5.1 or higher -->
        <version.maven-invoker-plugin>3.0.1</version.maven-invoker-plugin>
        <version.maven-jar-plugin>3.0.2</version.maven-jar-plugin>
        <version.maven-javadoc-plugin>3.0.0</version.maven-javadoc-plugin>
        <version.maven-source-plugin>3.0.1</version.maven-source-plugin>
        <version.maven-gpg-plugin>1.6</version.maven-gpg-plugin>
        <version.maven-jxr-plugin>2.5</version.maven-jxr-plugin>
        <version.maven-pmd-plugin>3.9.0</version.maven-pmd-plugin>
        <version.maven-project-info-reports-plugin>2.9</version.maven-project-info-reports-plugin>
        <version.maven-resources-plugin>3.0.2</version.maven-resources-plugin>
        <version.maven-source-plugin>3.0.1</version.maven-source-plugin>
        <version.maven-shade-plugin>3.1.0</version.maven-shade-plugin>
        <version.maven-site-plugin>3.6</version.maven-site-plugin>
        <version.maven-surefire-report-plugin>2.20.1</version.maven-surefire-report-plugin>
        <version.maven-failsafe-plugin>2.20.1</version.maven-failsafe-plugin>
        <version.build-helper-maven-plugin>3.0.0</version.build-helper-maven-plugin>
        <version.maven-deploy-plugin>2.8.2</version.maven-deploy-plugin>
        <version.testng>6.14.2</version.testng>
    </properties>

    <distributionManagement>
        <site>
            <id>${project.artifactId}-site</id>
            <url>http://alternet.ml/alternet-libs/</url>
        </site>
        <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>

    <scm>
        <url>https://github.com/alternet/alternet.github.io</url>
        <connection>scm:git:https://github.com/alternet/alternet.github.io.git</connection>
        <developerConnection>scm:git:https://git@github.com/alternet/alternet.github.io.git</developerConnection>
        <tag>HEAD</tag>
    </scm>

    <issueManagement>
        <system>GitHub Issues</system>
        <url>http://github.com/alternet/alternet.ml/issues</url>
    </issueManagement>

    <licenses>
        <license>
            <name>The MIT License (MIT)</name>
            <url>http://alternet.ml/LICENSE.txt</url>
        </license>
    </licenses>

    <organization>
        <name>Alternet</name>
        <url>http://alternet.ml</url>
    </organization>

    <developers>
        <developer>
            <id>ppoulard</id>
            <name>Philippe Poulard</name>
            <email>philippe.poulard@inria.fr</email>
            <roles>
                <role>admin</role>
                <role>developer</role>
            </roles>
            <timezone>0</timezone>
        </developer>
    </developers>

    <dependencies>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>${version.assertj-core}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>${version.testng}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <modules>
        <module>../parsing</module>
        <module>../scanner</module>
        <module>../security</module>
        <module>../security-auth</module>
        <module>../security-jetty-9.1</module>
        <module>../security-tomcat-8.0</module>
        <module>../tools</module>
        <module>../tools-generator</module>
        <module>../prop-bind-maven-plugin</module>
    </modules>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>${version.maven-site-plugin}</version>
                <configuration>
                    <generateReports>true</generateReports>
                    <inputEncoding>UTF-8</inputEncoding>
                    <outputEncoding>UTF-8</outputEncoding>
                    <skipDeploy>true</skipDeploy>
                    <outputDirectory>${site.deploy.dir}</outputDirectory>
                </configuration>
                <executions>
                    <execution>
                        <id>stage-site</id>
                        <phase>post-site</phase>
                        <goals>
                            <goal>stage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${version.maven-checkstyle-plugin}</version>
                <dependencies>
                    <dependency>
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>${version.checkstyle}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.7</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>false</autoReleaseAfterClose>
                </configuration>
            </plugin>
        </plugins>

        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-invoker-plugin</artifactId>
                    <version>${version.maven-invoker-plugin}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${version.maven-compiler-plugin}</version>
                    <configuration>
                        <source>${java.version}</source>
                        <target>${java.version}</target>
                        <compilerArgument>-Xlint:all</compilerArgument>
                        <showWarnings>true</showWarnings>
                        <showDeprecation>true</showDeprecation>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${version.maven-javadoc-plugin}</version>
                    <configuration>
                        <failOnError>false</failOnError>
                        <additionalparam>-Xdoclint:none</additionalparam>
                        <links>
                            <link>http://docs.oracle.com/javase/8/docs/api/</link>
                            <link>http://docs.oracle.com/javaee/7/api/</link>
                            <link>http://alternet.ml/alternet-libs/apidocs/</link>
                        </links>
                        <subpackages>ml.alternet</subpackages>
                        <excludePackageNames>ml.alternet.util.gen.sample</excludePackageNames>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${version.maven-source-plugin}</version>
                    <executions>
                        <execution>
                            <id>attach-sources</id>
                            <goals>
                                <goal>jar-no-fork</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>${version.maven-gpg-plugin}</version>
                    <executions>
                        <execution>
                            <id>sign-artifacts</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>${version.build-helper-maven-plugin}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>${version.maven-deploy-plugin}</version>
                </plugin>
                <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.codehaus.mojo</groupId>
                                        <artifactId>build-helper-maven-plugin</artifactId>
                                        <versionRange>[1.9,)</versionRange>
                                        <goals>
                                            <goal>compile</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>${version.maven-project-info-reports-plugin}</version>
                <configuration>
                    <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
                    <webAccessUrl>https://github.com/alternet/alternet.ml</webAccessUrl>
                    <anonymousConnection>scm:git:https://github.com/alternet/alternet.ml.git</anonymousConnection>
                    <developerConnection>scm:git:https://git@github.com/alternet/alternet.ml.git</developerConnection>
                </configuration>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>summary</report>
                            <report>license</report>
                            <report>modules</report>
                            <report>project-team</report>
                            <report>scm</report>
                            <report>issue-tracking</report>
                            <report>dependencies</report>
                            <report>dependency-convergence</report>
                            <report>plugins</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${version.maven-javadoc-plugin}</version>
                <reportSets>
                    <reportSet>
                        <id>aggregate</id>
                        <inherited>true</inherited>
                        <reports>
                            <report>aggregate</report>
                        </reports>
                    </reportSet>
                </reportSets>
                <configuration>
                    <failOnError>false</failOnError>
                    <additionalparam>-Xdoclint:none</additionalparam>
                    <links>
                        <link>http://docs.oracle.com/javase/8/docs/api/</link>
                        <link>http://docs.oracle.com/javaee/7/api/</link>
                        <link>http://alternet.ml/alternet-libs/apidocs/</link>
                    </links>
                    <subpackages>ml.alternet</subpackages>
                    <excludePackageNames>ml.alternet.util.gen.sample</excludePackageNames>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jxr-plugin</artifactId>
                <version>${version.maven-jxr-plugin}</version>
                <reportSets>
                    <reportSet>
                        <id>aggregate</id>
                        <inherited>false</inherited>
                        <reports>
                            <report>aggregate</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>${version.maven-surefire-report-plugin}</version>
                <configuration>
                    <showSuccess>true</showSuccess>
                    <outputDirectory>${basedir}/target/test-output</outputDirectory>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <version>${version.maven-pmd-plugin}</version>
                <configuration>
                    <targetJdk>${java.version}</targetJdk>
                    <analysisCache>true</analysisCache> <!-- enable incremental analysis -->
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${version.maven-checkstyle-plugin}</version>
                <configuration>
                    <configLocation>src/conf/checkstyle.xml</configLocation>
                    <failOnViolation>false</failOnViolation>
                </configuration>
            </plugin>
        </plugins>
    </reporting>

    <profiles>
        <profile>
            <id>site-deploy</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>

            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-site-plugin</artifactId>
                        <configuration>
                            <skip>true</skip>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-resources-plugin</artifactId>
                        <version>${version.maven-resources-plugin}</version>
                        <inherited>false</inherited>
                        <executions>
                            <execution>
                                <id>copy-site</id>
                                <phase>site-deploy</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${github.local.dir}/alternet-libs</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>${site.deploy.dir}</directory>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>com.github.github</groupId>
                        <artifactId>site-maven-plugin</artifactId>
                        <version>${version.github.site-maven-plugin}</version>
                        <inherited>false</inherited>
                        <executions>
                            <execution>
                                <id>site.project-website</id>
                                <goals>
                                    <goal>site</goal>
                                </goals>
                                <phase>site-deploy</phase>
                                <configuration>
                                    <outputDirectory>${github.local.dir}</outputDirectory>
                                    <message>Creating site for ${project.version}</message>
                                     <branch>refs/heads/master</branch>
                                    <dryRun>false</dryRun>
                                    <excludes>
                                        <exclude>**/.git/**</exclude>
                                        <exclude>**/.DS_Store</exclude>
                                        <exclude>.gitignore</exclude>
                                    </excludes>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>default-profile</id>
            <activation>
                <activeByDefault>true</activeByDefault>
                <file>
                    <exists>${java.home}/../lib/tools.jar</exists>
                </file>
            </activation>
            <properties>
                <toolsjar>${java.home}/../lib/tools.jar</toolsjar>
            </properties>
        </profile>
        <profile>
            <id>mac-profile</id>
            <activation>
                <activeByDefault>false</activeByDefault>
                <file>
                    <exists>${java.home}/../Classes/classes.jar</exists>
                </file>
            </activation>
            <properties>
                <toolsjar>${java.home}/../Classes/classes.jar</toolsjar>
            </properties>
        </profile>
        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-gpg-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>