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

    <parent>
        <groupId>com.atlassian.pom</groupId>
        <artifactId>closedsource-private-pom</artifactId>
        <version>7.0.0</version>
    </parent>

    <groupId>com.atlassian.oauth</groupId>
    <artifactId>atlassian-oauth</artifactId>
    <version>6.1.13</version>
    <packaging>pom</packaging>

    <name>Atlassian OAuth - Parent</name>
    <description>Plugin to provide support for OAuth in our RESTful APIs</description>
    <licenses>
        <license>
            <name>BSD License</name>
            <url>http://opensource.org/licenses/BSD-3-Clause</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <modules>
        <module>api</module>
        <module>test-utils</module>
        <module>bridge</module>
        <module>shared</module>
        <module>consumer-plugin</module>
        <module>consumer-spi</module>
        <module>consumer-core</module>
        <module>consumer-sal-plugin</module>
        <module>service-provider-spi</module>
        <module>service-provider-plugin</module>
        <module>service-provider-sal-plugin</module>
        <module>service-provider-testdata-plugin</module>
        <module>admin-plugin</module>
        <module>signature-generator-plugin</module>
        <module>integration-tests</module>
        <module>atlassian-oauth-pageobjects</module>
    </modules>

    <scm>
        <connection>scm:git:git@bitbucket.org:atlassian/dc-platform-closed-source.git</connection>
        <developerConnection>scm:git:git@bitbucket.org:atlassian/dc-platform-closed-source.git</developerConnection>
        <url>https://bitbucket.org/atlassian/dc-platform-closed-source</url>
        <tag>atlassian-oauth-6.1.13</tag>
    </scm>
    <issueManagement>
        <system>Jira</system>
        <url>https://ecosystem.atlassian.net/browse/OAUTH</url>
    </issueManagement>
    <ciManagement>
        <system>Bamboo</system>
        <url>https://ecosystem-bamboo.internal.atlassian.com/browse/OAUTH</url>
    </ciManagement>

    <properties>
        <failOnMilestoneOrReleaseCandidateDeps>false</failOnMilestoneOrReleaseCandidateDeps>

        <platform.version>7.1.0-rc4</platform.version>
        <amps.version>8.17.7</amps.version>
        <confluence.version>9.0.3</confluence.version>

        <hamcrest.version>1.3</hamcrest.version>
        <mockito.version>2.28.2</mockito.version>

        <atlassian.selenium>3.3.3</atlassian.selenium>
        <!-- This library is maintained at https://bitbucket.org/atlassian/netoauth -->
        <net.oauth.version>20100601-atlassian-5</net.oauth.version>
        <atlassian.plugins.osgi.javaconfig.version>0.6.0</atlassian.plugins.osgi.javaconfig.version>

        <jacoco.report.file>sonar-aggregator/target/site/jacoco-aggregate/jacoco.xml</jacoco.report.file>
        <sonar.coverage.exclusions>
            admin-plugin/**,
            atlassian-oauth-pageobjects/**,
            integration-tests/**,
            test-utils/**
        </sonar.coverage.exclusions>
        <webdriver.browser>firefox</webdriver.browser>
        <xvfb.enable>true</xvfb.enable>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.atlassian.platform.dependencies</groupId>
                <artifactId>platform-internal-api</artifactId>
                <version>${platform.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>com.atlassian.platform.dependencies</groupId>
                <artifactId>platform-public-api</artifactId>
                <version>${platform.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>com.atlassian.platform.dependencies</groupId>
                <artifactId>platform-bundled-plugins</artifactId>
                <version>${platform.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>com.atlassian.platform.dependencies</groupId>
                <artifactId>platform-test-resources</artifactId>
                <version>${platform.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>atlassian-oauth-admin-plugin</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>atlassian-oauth-api</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>atlassian-oauth-pageobjects</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>atlassian-oauth-bridge</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>atlassian-oauth-consumer-core</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>atlassian-oauth-consumer-plugin</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>atlassian-oauth-consumer-sal-plugin</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>atlassian-oauth-consumer-spi</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>atlassian-oauth-service-provider-spi</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>atlassian-oauth-integration-tests</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>atlassian-oauth-service-provider-plugin</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>atlassian-oauth-service-provider-sal-plugin</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>atlassian-oauth-service-provider-testdata-plugin</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>atlassian-oauth-shared</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>atlassian-oauth-signature-generator-plugin</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>atlassian-oauth-test-utils</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>com.atlassian.selenium</groupId>
                <artifactId>atlassian-webdriver-core</artifactId>
                <version>${atlassian.selenium}</version>
                <exclusions>
                    <exclusion>
                        <groupId>com.google.guava</groupId>
                        <artifactId>guava</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>com.atlassian.selenium</groupId>
                <artifactId>atlassian-pageobjects-elements</artifactId>
                <version>${atlassian.selenium}</version>
            </dependency>

            <dependency>
                <groupId>com.atlassian.confluence</groupId>
                <artifactId>confluence</artifactId>
                <version>${confluence.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>com.atlassian.bonnie</groupId>
                        <artifactId>atlassian-bonnie</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>com.fasterxml.jackson.core</groupId>
                        <artifactId>jackson-databind</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>com.fasterxml.jackson.core</groupId>
                        <artifactId>jackson-annotations</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>com.fasterxml.jackson.datatype</groupId>
                        <artifactId>jackson-datatype-joda</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>com.fasterxml.jackson.core</groupId>
                        <artifactId>jackson-core</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>xalan</groupId>
                        <artifactId>xalan</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <dependency>
                <groupId>net.jcip</groupId>
                <artifactId>jcip-annotations</artifactId>
                <version>1.0</version>
            </dependency>
            <dependency>
                <groupId>net.oauth.core</groupId>
                <artifactId>oauth</artifactId>
                <version>${net.oauth.version}</version>
            </dependency>
            <dependency>
                <groupId>net.oauth.core</groupId>
                <artifactId>oauth-provider</artifactId>
                <version>${net.oauth.version}</version>
            </dependency>
            <dependency>
                <groupId>net.oauth.core</groupId>
                <artifactId>oauth-httpclient4</artifactId>
                <version>${net.oauth.version}</version>
            </dependency>
            <dependency>
                <groupId>commons-codec</groupId>
                <artifactId>commons-codec</artifactId>
                <version>1.15</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.plugins</groupId>
                <artifactId>atlassian-plugins-osgi-javaconfig</artifactId>
                <version>${atlassian.plugins.osgi.javaconfig.version}</version>
            </dependency>
            <dependency>
                <groupId>commons-collections</groupId>
                <artifactId>commons-collections</artifactId>
                <version>3.2.2</version>
            </dependency>
            <dependency>
                <groupId>xerces</groupId>
                <artifactId>xercesImpl</artifactId>
                <version>2.12.2</version>
            </dependency>
            <dependency>
                <groupId>net.sourceforge.htmlunit</groupId>
                <artifactId>htmlunit</artifactId>
                <version>2.66.0</version>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.13.2</version>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-core</artifactId>
                <version>${hamcrest.version}</version>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-library</artifactId>
                <version>${hamcrest.version}</version>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.atlassian.maven.plugins</groupId>
                    <artifactId>amps-maven-plugin</artifactId>
                    <version>${amps.version}</version>
                    <extensions>true</extensions>
                    <configuration>
                        <platformVersion>${platform.version}</platformVersion>
                        <skipRestDocGeneration>true</skipRestDocGeneration>
                        <extractDependencies>false</extractDependencies>
                        <jvmArgs>${jacoco.agent.it.argLine}</jvmArgs>
                    </configuration>
                    <executions>
                        <execution>
                            <id>js-enforcement</id>
                            <goals>
                                <goal>verify-fe-manifest-associations</goal>
                            </goals>
                            <phase>verify</phase>
                            <configuration>
                                <verifyFeManifestAssociationsInputEntrypoint>
                                    ${project.build.directory}/${project.build.finalName}.jar
                                </verifyFeManifestAssociationsInputEntrypoint>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>ban-milestones-and-release-candidates</id>
                            <!-- DCPL-1364 After Platform 7 goes live change to "validate" -->
                            <phase>none</phase>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <excludePackageNames>
                        *.internal:com.atlassian.gadgets.refimpl:com.atlassian.gadgets.test:com.atlassian.gadgets.util
                    </excludePackageNames>
                </configuration>
                <reportSets>
                    <reportSet>
                        <id>aggregate</id>
                        <inherited>false</inherited><!-- don't run aggregate in child modules -->
                        <reports>
                            <report>aggregate</report>
                            <!-- don't do test-aggregate -->
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    </reporting>

    <profiles>
        <profile>
            <id>jacoco</id>
            <properties>
                <jacoco.include.pattern>com/atlassian/oauth/**</jacoco.include.pattern>
            </properties>
            <build>
                <plugins>
                    <!-- Code coverage -->
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>0.8.8</version>
                        <executions>
                            <execution>
                                <id>agent-for-ut</id>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                                <configuration>
                                    <propertyName>jacoco.agent.argLine</propertyName>
                                    <includes>
                                        <include>${jacoco.include.pattern}</include>
                                    </includes>
                                </configuration>
                            </execution>
                            <execution>
                                <id>agent-for-it</id>
                                <goals>
                                    <goal>prepare-agent-integration</goal>
                                </goals>
                                <phase>initialize</phase>
                                <configuration>
                                    <propertyName>jacoco.agent.it.argLine</propertyName>
                                    <includes>
                                        <include>${jacoco.include.pattern}</include>
                                    </includes>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <argLine>@{jacoco.agent.argLine}</argLine>
                            <systemPropertyVariables>
                                <xvfb.enable>true</xvfb.enable>
                            </systemPropertyVariables>
                            <excludes>
                                <exclude>%regex[it[/\\].*]</exclude>
                                <exclude>**/*$*</exclude>
                            </excludes>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <argLine>@{jacoco.agent.it.argLine}</argLine>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
