<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ The MIT License (MIT)
  ~
  ~ Copyright (c) 2014-2018 Christian Schudt
  ~
  ~ Permission is hereby granted, free of charge, to any person obtaining a copy
  ~ of this software and associated documentation files (the "Software"), to deal
  ~ in the Software without restriction, including without limitation the rights
  ~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  ~ copies of the Software, and to permit persons to whom the Software is
  ~ furnished to do so, subject to the following conditions:
  ~
  ~ The above copyright notice and this permission notice shall be included in
  ~ all copies or substantial portions of the Software.
  ~
  ~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  ~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  ~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  ~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  ~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  ~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  ~ THE SOFTWARE.
  -->

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

    <groupId>rocks.xmpp</groupId>
    <artifactId>root</artifactId>
    <version>0.8.2</version>
    <packaging>pom</packaging>

    <name>XMPP.rocks - An XMPP Stack</name>
    <description>An XMPP Stack</description>

    <!-- Project Site -->
    <url>http://xmpp.rocks</url>

    <!-- Licenses -->
    <licenses>
        <license>
            <name>MIT License</name>
            <url>http://www.opensource.org/licenses/mit-license</url>
        </license>
    </licenses>

    <!-- Developers -->
    <developers>
        <developer>
            <name>Christian Schudt</name>
            <roles>
                <role>developer</role>
            </roles>
            <timezone>+01:00</timezone>
        </developer>
    </developers>

    <!-- Developers -->
    <organization>
        <name>XMPP.rocks</name>
        <url>http://xmpp.rocks</url>
    </organization>

    <!-- Issue Management -->
    <issueManagement>
        <system>Bitbucket</system>
        <url>https://bitbucket.org/sco0ter/babbler/issues</url>
    </issueManagement>

    <!-- Mailing Lists -->
    <mailingLists>
    </mailingLists>

    <!-- Source Control Management -->
    <scm>
        <url>https://bitbucket.org/sco0ter/babbler/src</url>
        <connection>scm:git:git@bitbucket.org:sco0ter/babbler.git</connection>
        <developerConnection>scm:git:git@bitbucket.org:sco0ter/babbler.git</developerConnection>
    </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    </properties>

    <inceptionYear>2014</inceptionYear>

    <modules>
        <module>xmpp-addr</module>
        <module>xmpp-core</module>
        <module>xmpp-extensions</module>
        <module>xmpp-debug</module>
        <module>xmpp-sample</module>
        <module>xmpp-documentation</module>
        <module>xmpp-fx</module>
        <module>xmpp-websocket</module>
        <module>xmpp-nio</module>
    </modules>

    <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>
    <reporting>
        <plugins>
            <plugin>
                <groupId>com.github.spotbugs</groupId>
                <artifactId>spotbugs-maven-plugin</artifactId>
                <version>3.1.5</version>
            </plugin>
        </plugins>
    </reporting>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>analyze</id>
                        <goals>
                            <goal>analyze-only</goal>
                        </goals>
                        <configuration>
                            <ignoreNonCompile>true</ignoreNonCompile>
                            <failOnWarning>true</failOnWarning>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- Do not generate a site for the root project -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <inherited>false</inherited>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <version>2.4</version>
                <inherited>false</inherited>
                <configuration>
                    <newVersion>0.8.2</newVersion>
                    <generateBackupPoms>false</generateBackupPoms>
                </configuration>
                <executions>
                    <execution>
                        <id>display-plugin-updates</id>
                        <goals>
                            <goal>display-plugin-updates</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- Do not deploy the root pom and also disable deployment via maven-deploy-plugin -->
            <!-- We are using nexus-staging-maven-plugin for deployment -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <inherited>false</inherited>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <compilerId>javac-with-errorprone</compilerId>
                    <forceJavacCompilerUse>true</forceJavacCompilerUse>
                    <source>8</source>
                    <target>8</target>
                    <showWarnings>true</showWarnings>
                    <compilerArgs>
                        <arg>-Xep:FutureReturnValueIgnored:OFF</arg>
                    </compilerArgs>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.codehaus.plexus</groupId>
                        <artifactId>plexus-compiler-javac-errorprone</artifactId>
                        <version>2.8.4</version>
                    </dependency>
                    <!-- override plexus-compiler-javac-errorprone's dependency on
                         Error Prone with the latest version -->
                    <dependency>
                        <groupId>com.google.errorprone</groupId>
                        <artifactId>error_prone_core</artifactId>
                        <version>2.3.1</version>
                    </dependency>
                </dependencies>
            </plugin>

            <!-- Generate sources jar -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>3.1.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.7.0</version>
                </plugin>

                <!-- Use doxia-module-markdown for mvn site -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>3.7</version>
                    <configuration>
                        <locales>en</locales>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.apache.maven.doxia</groupId>
                            <artifactId>doxia-module-markdown</artifactId>
                            <version>1.7</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-project-info-reports-plugin</artifactId>
                    <version>3.0.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.8.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.0.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.0.1</version>
                    <configuration>
                        <groups>
                            <group>
                                <title>XMPP Address Format (RFC 7622)</title>
                                <packages>rocks.xmpp.addr*</packages>
                            </group>
                            <group>
                                <title>XMPP Core (RFC 6120)</title>
                                <packages>rocks.xmpp.core*</packages>
                            </group>
                            <group>
                                <title>XMPP Instant Messaging and Presence (RFC 6121)</title>
                                <packages>rocks.xmpp.im*</packages>
                            </group>
                            <group>
                                <title>XMPP Extensions</title>
                                <packages>rocks.xmpp.extensions*</packages>
                            </group>
                            <group>
                                <title>XMPP WebSocket Support (RFC 7395)</title>
                                <packages>rocks.xmpp.websocket*</packages>
                            </group>
                            <group>
                                <title>XMPP NIO Connection Support</title>
                                <packages>rocks.xmpp.nio*</packages>
                            </group>
                            <group>
                                <title>JavaFX Controls Useful for XMPP Clients</title>
                                <packages>rocks.xmpp.javafx*</packages>
                            </group>
                        </groups>
                        <quiet>true</quiet>
                        <reportOutputDirectory>${project.build.directory}</reportOutputDirectory>
                        <includeDependencySources>false</includeDependencySources>
                        <includeTransitiveDependencySources>false</includeTransitiveDependencySources>
                        <nodeprecated>false</nodeprecated>
                        <nodeprecatedlist>false</nodeprecatedlist>
                        <author>false</author>
                        <notimestamp>true</notimestamp>
                        <doctitle>Babbler ${project.version}</doctitle>
                        <windowtitle>Babbler ${project.version}</windowtitle>
                        <docfilessubdirs>true</docfilessubdirs>
                        <show>public</show>

                        <!--> Markdown doclet -->
                        <doclet>ch.raffael.mddoclet.MarkdownDoclet</doclet>
                        <docletArtifact>
                            <groupId>ch.raffael.markdown-doclet</groupId>
                            <artifactId>markdown-doclet</artifactId>
                            <version>1.4</version>
                        </docletArtifact>
                        <useStandardDocletOptions>true</useStandardDocletOptions>
                        <additionalOptions>
                            <additionalOption>-highlight-style</additionalOption>
                            <additionalOption>tomorrow</additionalOption>
                        </additionalOptions>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.1.0</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-install-plugin</artifactId>
                    <version>2.5.2</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-shade-plugin</artifactId>
                    <version>3.1.1</version>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>1.6.8</version>
                    <extensions>true</extensions>
                    <configuration>
                        <serverId>ossrh</serverId>
                        <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                        <autoReleaseAfterClose>false</autoReleaseAfterClose>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>2.21.0</version>
                    <executions>
                        <execution>
                            <id>integration-test</id>
                            <goals>
                                <goal>integration-test</goal>
                                <goal>verify</goal>
                            </goals>
                            <configuration>
                                <!-- Skip tests by default -->
                                <!-- Run integration tests with: mvn failsafe:integration-test -->
                                <skipTests>true</skipTests>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.21.0</version>
                    <configuration>
                        <argLine>-Xmx1024m</argLine>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.testng</groupId>
                <artifactId>testng</artifactId>
                <version>6.8.8</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <profiles>
        <profile>
            <id>jdk9</id>
            <activation>
                <jdk>9</jdk>
            </activation>
            <dependencies>
                <!-- These dependencies were removed in JDK 9 -->
                <dependency>
                    <groupId>javax.xml.bind</groupId>
                    <artifactId>jaxb-api</artifactId>
                    <version>2.3.0</version>
                </dependency>
                <dependency>
                    <groupId>javax.xml.soap</groupId>
                    <artifactId>saaj-api</artifactId>
                    <version>1.3.5</version>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>release</id>
            <build>
                <plugins>

                    <!-- Generate JavaDoc -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- Sign the artifacts -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>