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

    <name>Extensions on Apache Proton-J library</name>
    <description>Extensions on Apache Proton-J library</description>
    <url>https://github.com/Azure/qpid-proton-j-extensions</url>

    <modelVersion>4.0.0</modelVersion>

    <groupId>com.microsoft.azure</groupId>
    <artifactId>qpid-proton-j-extensions</artifactId>
    <version>1.2.3</version>

    <licenses>
        <license>
        <name>The MIT License (MIT)</name>
        <url>http://opensource.org/licenses/MIT</url>
        <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
        <id>microsoft</id>
        <name>Microsoft Corporation</name>
        </developer>
    </developers>

    <scm>
        <url>https://github.com/Azure/qpid-proton-j-extensions</url>
        <connection>scm:git:https://github.com/Azure/qpid-proton-j-extensions.git</connection>
        <developerConnection>scm:git:https://github.com/Azure/qpid-proton-j-extensions.git</developerConnection>
    </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <packageOutputDirectory>${project.build.directory}</packageOutputDirectory>

        <!-- Product dependency versions -->
        <proton-j-version>0.33.4</proton-j-version>
        <slf4j-version>1.7.28</slf4j-version>

        <!-- Test dependency versions -->
        <junit-version>4.12</junit-version>
        <mockito-version>3.0.0</mockito-version>

        <!-- Maven tool versions -->
        <maven-checkstyle-plugin.version>3.1.0</maven-checkstyle-plugin.version>
        <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
        <maven-jar-plugin.version>3.1.2</maven-jar-plugin.version>
        <maven-javadoc-plugin.version>3.1.1</maven-javadoc-plugin.version>
        <maven-source-plugin.version>3.0.1</maven-source-plugin.version>

        <!-- Build tools -->
        <checkstyle.version>8.29</checkstyle.version>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${maven-checkstyle-plugin.version}</version>
                <executions>
                    <execution>
                        <id>validate</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>${checkstyle.version}</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <configLocation>checkstyle.xml</configLocation>
                    <encoding>UTF-8</encoding>
                    <consoleOutput>true</consoleOutput>
                    <linkXRef>true</linkXRef>

                    <failsOnError>true</failsOnError>
                    <failOnViolation>true</failOnViolation>
                    <violationSeverity>warning</violationSeverity>
                </configuration>
            </plugin>

            <!-- Configure the jar plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${maven-jar-plugin.version}</version>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Automatic-Module-Name>com.microsoft.azure.qpid.protonj.extensions</Automatic-Module-Name>
                        </manifestEntries>
                    </archive>
                    <outputDirectory>${packageOutputDirectory}</outputDirectory>
                </configuration>
            </plugin>

            <!-- Configure the source plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${maven-source-plugin.version}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${packageOutputDirectory}</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- Configure the javadoc 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>
                        <configuration>
                            <jarOutputDirectory>${packageOutputDirectory}</jarOutputDirectory>
                            <failOnError>true</failOnError>
                            <failOnWarnings>true</failOnWarnings>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.apache.qpid</groupId>
            <artifactId>proton-j</artifactId>
            <version>${proton-j-version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j-version}</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit-version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${mockito-version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>${slf4j-version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <profiles>
    <!-- By default we build against our baseline, Java 8, but we also want to ensure compatibility against the latest
        Java LTS release, currently Java 11. We therefore have two profiles:
        * The default 'java8', which will perform a build using Java 8 as its target.
        * The non-default 'java-lts' profile, which will build against the current LTS release. -->
        <profile>
            <id>java8</id>
            <activation>
                <activeByDefault>true</activeByDefault>
                <property>
                    <name>!java-lts</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <version>${maven-compiler-plugin.version}</version>
                        <configuration>
                            <source>1.8</source>
                            <target>1.8</target>
                            <showWarnings>true</showWarnings>
                            <failOnWarning>true</failOnWarning>
                            <!-- Ignore these until we fix ProxyImpl exposing raw types. -->
                            <!-- <compilerArgs>
                                <arg>-Xlint:all</arg>
                                <arg>-Xlint:-serial</arg>
                                <arg>-Xlint:-deprecation</arg>
                            </compilerArgs> -->
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>java-lts</id>
            <activation>
                <property>
                <name>java-lts</name>
                </property>
            </activation>
            <build>
                <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                    <configuration>
                    <source>11</source>
                    <target>11</target>
                    <showWarnings>true</showWarnings>
                    <failOnWarning>true</failOnWarning>
                    <!-- Ignore these until we fix ProxyImpl exposing raw types. -->
                    <!-- <compilerArgs>
                        <arg>-Xlint:all</arg>
                        <arg>-Xlint:-serial</arg>
                        <arg>-Xlint:-deprecation</arg>
                    </compilerArgs> -->
                    </configuration>
                </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
