<?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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <name>HERE AAA Client SDK Parent POM</name>
    <groupId>com.here.account</groupId>
    <artifactId>here-aaa-sdk</artifactId>
    <version>0.4.33</version>
    <packaging>pom</packaging>
    <description>here-aaa-sdk is for clients of the HERE AAA, and demos grant_type=client_credentials</description>
    <url>http://github.com/heremaps/here-aaa-java-sdk</url>

    <licenses>
        <license>
          <name>Apache License, Version 2.0</name>
          <url>https://github.com/heremaps/here-aaa-java-sdk/blob/master/LICENSE</url>
          <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
          <name>Riccardo Gulia</name>
          <email>riccardo.gulia@here.com</email>
          <organization>HERE Europe B.V.</organization>
          <organizationUrl>https://github.com/heremaps</organizationUrl>
        </developer>
    </developers>

    <scm>
      <connection>scm:git:https://github.com/heremaps/here-aaa-java-sdk.git</connection>
      <developerConnection>scm:git:git@github.com:heremaps/here-aaa-java-sdk.git</developerConnection>
      <url>https://github.com/heremaps/here-aaa-java-sdk</url>
    </scm>

    <modules>
        <module>here-oauth-client</module>
        <module>examples/here-oauth-client-example</module>
        <module>here-oauth-client-dist</module>
    </modules>

    <properties>

        <!-- Begin From prior parent -->
        <general.encoding>UTF-8</general.encoding>
        <java.version>1.8</java.version>
        <project.build.sourceEncoding>${general.encoding}</project.build.sourceEncoding>
        <java.source.linelength>120</java.source.linelength>
        <java.source.tabwidth>4</java.source.tabwidth>
        <project.reporting.outputEncoding>${general.encoding}</project.reporting.outputEncoding>

        <!-- Declare versions for plugins -->
        <jacoco-maven-plugin.version>0.8.13</jacoco-maven-plugin.version>
        <maven-assembly-plugin.version>2.6</maven-assembly-plugin.version>
        <maven-compiler-plugin.version>3.14.0</maven-compiler-plugin.version>
        <maven-failsafe-plugin.version>2.19.1</maven-failsafe-plugin.version>
        <maven-jar-plugin.version>3.0.2</maven-jar-plugin.version>
        <maven-javadoc-plugin.version>3.11.3</maven-javadoc-plugin.version>
        <maven-source-plugin.version>2.3</maven-source-plugin.version>
        <maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>        
        <maven-gpg-plugin.version>3.2.8</maven-gpg-plugin.version>

        <maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
        <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>

        <!-- Declare versions for dependencies -->
        <apache.httpclient.version>4.5.14</apache.httpclient.version>
        <commons-configuration2.version>2.12.0</commons-configuration2.version>
        <jackson.version>2.19.2</jackson.version>
        <junit.version>4.13.2</junit.version>
        <mockito.version>1.10.19</mockito.version>
        <org.asynchttpclient.version>2.12.4</org.asynchttpclient.version>
        <browsermob.version>2.1.5</browsermob.version>
        <io.netty.version>4.2.3.Final</io.netty.version>
        <org.slf4j.version>2.0.17</org.slf4j.version>
        <com.google.guava.version>33.4.8-android</com.google.guava.version>
        <commons.logging.version>1.3.5</commons.logging.version>
        <com.fasterxml.jackson.core.version>2.19.2</com.fasterxml.jackson.core.version>
        <org.apache.commons.version>3.18.0</org.apache.commons.version>

        <!-- configure surefire and maven to be individually skippable -->
        <!-- set to skip all tests -->
        <skipTests>false</skipTests>
        <!-- set to skip only unit tests -->
        <skip.unit.tests>${skipTests}</skip.unit.tests>
        <!-- set to skip only integration tests -->
        <skip.integration.tests>${skipTests}</skip.integration.tests>

        <!-- custom properties to support jacoco configuration -->
        <jacoco.it.execution.data.file>${project.build.directory}/coverage-reports/jacoco-it.exec</jacoco.it.execution.data.file>
        <jacoco.ut.execution.data.file>${project.build.directory}/coverage-reports/jacoco-ut.exec</jacoco.ut.execution.data.file>
        <argLine/>

    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-configuration2</artifactId>
                <version>${commons-configuration2.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpclient</artifactId>
                <version>${apache.httpclient.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>commons-logging</groupId>
                        <artifactId>commons-logging</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>net.lightbody.bmp</groupId>
                <artifactId>browsermob-core</artifactId>
                <version>${browsermob.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>io.netty</groupId>
                        <artifactId>netty-all</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-api</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>jcl-over-slf4j</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>com.google.guava</groupId>
                        <artifactId>guava</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>commons-logging</groupId>
                        <artifactId>commons-logging</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.apache.commons</groupId>
                        <artifactId>commons-lang3</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>com.fasterxml.jackson.core</groupId>
                        <artifactId>jackson-annotations</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>com.fasterxml.jackson.core</groupId>
                        <artifactId>jackson-core</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <!-- test dependencies -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-all</artifactId>
                <version>${mockito.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.asynchttpclient</groupId>
                <artifactId>async-http-client</artifactId>
                <version>${org.asynchttpclient.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>io.netty</groupId>
                <artifactId>netty-all</artifactId>
                <version>${io.netty.version}</version>
            </dependency>
            <dependency>
                <groupId>io.netty</groupId>
                <artifactId>netty-handler</artifactId>
                <version>${io.netty.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${org.slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>jcl-over-slf4j</artifactId>
                <version>${org.slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>${com.google.guava.version}</version>
            </dependency>
            <dependency>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
                <version>${commons.logging.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>${org.apache.commons.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-annotations</artifactId>
                <version>${com.fasterxml.jackson.core.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-core</artifactId>
                <version>${com.fasterxml.jackson.core.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <defaultGoal>package</defaultGoal>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.sonatype.central</groupId>
                    <artifactId>central-publishing-maven-plugin</artifactId>
                    <version>0.8.0</version>
                    <extensions>true</extensions>
                    <configuration>
                        <publishingServerId>central</publishingServerId>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>${maven-assembly-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                    <configuration>
                        <compilerVersion>${java.version}</compilerVersion>
                        <source>${java.version}</source>
                        <target>${java.version}</target>
                        <encoding>${project.build.sourceEncoding}</encoding>
                        <showDeprecation>true</showDeprecation>
                        <showWarnings>true</showWarnings>
                        <optimize>false</optimize>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${maven-jar-plugin.version}</version>
                    <configuration>
                        <archive>
                            <manifest>
                                <addClasspath>true</addClasspath>
                                <classpathPrefix>lib/</classpathPrefix>
                            </manifest>
                        </archive>
                    </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-source-plugin</artifactId>
                    <version>${maven-source-plugin.version}</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-enforcer-plugin</artifactId>
                    <version>3.6.1</version>
                    <executions>
                        <execution>
                            <id>enforce-dependency-convergence</id>
                            <configuration>
                                <rules>
                                    <dependencyConvergence/>
                                    <requireUpperBoundDeps>
                                        <uniqueVersions>true</uniqueVersions>
                                    </requireUpperBoundDeps>
                                </rules>
                                <fail>true</fail>
                            </configuration>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>${maven-resources-plugin.version}</version>
                    <configuration>
                        <encoding>${project.build.sourceEncoding}</encoding>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                    <configuration>
                        <argLine>${argLine} ${surefireArgLine}</argLine>
                        <skipTests>${skip.unit.tests}</skipTests>
                    </configuration>
                </plugin>
                <!-- Used for integration tests -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>${maven-failsafe-plugin.version}</version>
                    <executions>
                        <!-- Ensures that both integration-test and verify 
                            goals of the Failsafe Maven plugin are executed. -->
                        <execution>
                            <id>integration-tests</id>
                            <goals>
                                <goal>integration-test</goal>
                                <goal>verify</goal>
                            </goals>
                            <configuration>
                                <!-- Sets the VM argument line used when 
                                    integration tests are run. -->
                                <argLine>${failsafeArgLine}</argLine>
                                <!-- Skips integration tests if the value 
                                    of skip.integration.tests property is true -->
                                <skipTests>${skip.integration.tests}</skipTests>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${jacoco-maven-plugin.version}</version>
                    <executions>
                        <!--
                            Prepares the property pointing to the JaCoCo runtime agent which
                            is passed as VM argument when Maven the Surefire plugin is executed.
                        -->
                        <execution>
                            <id>pre-unit-test</id>
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                            <configuration>
                                <!-- Sets the path to the file which contains the execution data. -->
                                <destFile>${jacoco.ut.execution.data.file}</destFile>
                                <!--
                                    Sets the name of the property containing the settings
                                    for JaCoCo runtime agent.
                                -->
                                <propertyName>surefireArgLine</propertyName>
                            </configuration>
                        </execution>
                        <!--
                            Ensures that the code coverage report for unit tests is created after
                            unit tests have been run.
                        -->
                        <execution>
                            <id>post-unit-test</id>
                            <phase>test</phase>
                            <goals>
                                <goal>report</goal>
                            </goals>
                            <configuration>
                                <!-- Sets the path to the file which contains the execution data. -->
                                <dataFile>${jacoco.ut.execution.data.file}</dataFile>
                                <!-- Sets the output directory for the code coverage report. -->
                                <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
                            </configuration>
                        </execution>
                        <!--
                            Prepares the property pointing to the JaCoCo runtime agent which
                            is passed as VM argument when Maven the Failsafe plugin is executed.
                        -->
                        <execution>
                            <id>pre-integration-test</id>
                            <phase>pre-integration-test</phase>
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                            <configuration>
                                <!-- Sets the path to the file which contains the execution data. -->
                                <destFile>${jacoco.it.execution.data.file}</destFile>
                                <!--
                                    Sets the name of the property containing the settings
                                    for JaCoCo runtime agent.
                                -->
                                <propertyName>failsafeArgLine</propertyName>
                            </configuration>
                        </execution>
                        <!--
                            Ensures that the code coverage report for integration tests after
                            integration tests have been run.
                        -->
                        <execution>
                            <id>post-integration-test</id>
                            <phase>post-integration-test</phase>
                            <goals>
                                <goal>report</goal>
                            </goals>
                            <configuration>
                                <!-- Sets the path to the file which contains the execution data. -->
                                <dataFile>${jacoco.it.execution.data.file}</dataFile>
                                <!-- Sets the output directory for the code coverage report. -->
                                <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
                            </configuration>
                        </execution>
                </executions>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
</project>
