<?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>org.dd4t</groupId>
    <artifactId>dd4t-parent</artifactId>
    <packaging>pom</packaging>
    <version>2.1.9</version>
    <name>${project.groupId}:${project.artifactId}</name>
    <description>Parent for all DD4T projects.</description>
    <url>https://github.com/dd4t</url>

    <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>Rogier Oudshoorn</name>
            <email>rogier.oudshoorn@gmail.com</email>
            <organization>DD4T</organization>
            <organizationUrl>https://github.com/dd4t</organizationUrl>
        </developer>
        <developer>
            <name>Raimond Kempees</name>
            <email>kempees@radagio.com</email>
            <organization>DD4T</organization>
            <organizationUrl>https://github.com/dd4t</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git@github.com:/dd4t/dd4t-2-java.git</connection>
        <developerConnection>scm:git:git@github.com:/dd4t/dd4t-2-java.git</developerConnection>
        <url>git@github.com:/dd4t/dd4t-2-java.git</url>
    </scm>

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

        <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
        <sonar.version>3.4.0.905</sonar.version>
    </properties>
    <build>
        <plugins>
            <plugin>
                <groupId>org.sonarsource.scanner.maven</groupId>
                <artifactId>sonar-maven-plugin</artifactId>
                <version>${sonar.version}</version>
            </plugin>
        </plugins>
    </build>


    <!--
        Release profile for deploying the core jars to Maven Central.
        Note: ONLY deploy the following:
         - dd4t-api
         - dd4t-core
         - dd4t-compatibility
         - dd4t-databind
         - dd4t-providers
         - dd4t-mvc-support

        Please do read: http://central.sonatype.org/pages/apache-maven.html

        For deploying a snapshot use:
        - mvn clean deploy -Prelease-central
        For deploying a release use (Will be automated through a buildserver):
        1. mvn versions:set -DnewVersion=2.0.1
        2. mvn clean deploy -Prelease-central
        3. mvn versions:set -DnewVersion=2.0.2-SNAPSHOT
    -->

    <modules>
        <module>dd4t-bom</module>
        <module>dd4t-bom-2013SP1</module>
        <module>dd4t-bom-web8</module>
        <module>dd4t-bom-tridion-9</module>
        <module>dd4t-api</module>
        <module>dd4t-caching</module>
        <module>dd4t-core</module>
        <module>dd4t-compatibility</module>
        <module>dd4t-databind</module>
        <module>dd4t-mvc-support</module>
        <module>dd4t-thymeleaf-support</module>
        <module>dd4t-providers-common</module>
        <module>dd4t-providers</module>
        <module>dd4t-providers-odata</module>
        <module>dd4t-test-spring-web</module>
        <module>dd4t-example-site</module>
    </modules>

    <profiles>
        <profile>
            <id>disable-java8-doclint</id>
            <activation>
                <jdk>[1.8,)</jdk>
            </activation>
            <properties>
                <additionalparam>-Xdoclint:none</additionalparam>
                <java-version>11</java-version>
                <javadoc.opts>-Xdoclint:none</javadoc.opts>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <version>${maven-compiler-plugin.version}</version>
                        <inherited>true</inherited>
                        <configuration>
                            <source>${java-version}</source>
                            <target>${java-version}</target>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>release-central</id>
            <distributionManagement>
                <snapshotRepository>
                    <id>ossrh</id>
                    <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
                </snapshotRepository>
                <repository>
                    <id>ossrh</id>
                    <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
                </repository>
            </distributionManagement>
            <modules>
                <module>dd4t-bom</module>
                <module>dd4t-bom-2013SP1</module>
                <module>dd4t-bom-web8</module>
                <module>dd4t-api</module>
                <module>dd4t-caching</module>
                <module>dd4t-core</module>
                <module>dd4t-compatibility</module>
                <module>dd4t-databind</module>
                <module>dd4t-mvc-support</module>
                <module>dd4t-thymeleaf-support</module>
                <module>dd4t-providers-common</module>
                <module>dd4t-providers</module>
                <module>dd4t-providers-odata</module>
            </modules>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <version>${maven-compiler-plugin.version}</version>
                        <inherited>true</inherited>
                        <configuration>
                            <source>${java-version}</source>
                            <target>${java-version}</target>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.5</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.2.1</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-javadoc-plugin</artifactId>
                        <version>2.9.1</version>
                        <configuration>
                            <source>8</source>
                            <additionalparam>${javadoc.opts}</additionalparam>
                        </configuration>
                        <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>3.0.1</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>