<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2020-Present, Okta, Inc.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<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.okta</groupId>
        <artifactId>okta-parent</artifactId>
        <version>21</version>
    </parent>

    <groupId>com.okta.idx.sdk</groupId>
    <artifactId>okta-idx-java-root</artifactId>
    <version>2.0.0</version>
    <packaging>pom</packaging>

    <name>Okta IDX Java SDK</name>
    <description>Okta IDX SDK for Java</description>
    <url>https://github.com/okta/okta-idx-java</url>
    <inceptionYear>2020</inceptionYear>

    <properties>
        <jackson.version>2.11.3</jackson.version>
        <snakeyaml.version>1.27</snakeyaml.version>
        <okta.commons.version>1.2.6</okta.commons.version>
        <okta.sdk.previousVersion>0.1.0-beta.8</okta.sdk.previousVersion>
        <github.slug>okta/okta-idx-java</github.slug>
    </properties>

    <modules>
        <module>api</module>
        <module>integration-tests</module>
        <module>coverage</module>
        <module>samples</module>
    </modules>

    <dependencyManagement>
        <dependencies>

            <dependency>
                <groupId>com.fasterxml.jackson</groupId>
                <artifactId>jackson-bom</artifactId>
                <version>${jackson.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>
            <dependency>
                <groupId>org.yaml</groupId>
                <artifactId>snakeyaml</artifactId>
                <version>${snakeyaml.version}</version>
            </dependency>

            <!-- Inter project dependencies -->
            <dependency>
                <groupId>com.okta.idx.sdk</groupId>
                <artifactId>okta-idx-java-api</artifactId>
                <version>${project.version}</version>
            </dependency>

            <!-- Other Okta Projects -->
            <dependency>
                <groupId>com.okta.commons</groupId>
                <artifactId>okta-config-check</artifactId>
                <version>${okta.commons.version}</version>
            </dependency>
            <dependency>
                <groupId>com.okta.commons</groupId>
                <artifactId>okta-commons-lang</artifactId>
                <version>${okta.commons.version}</version>
            </dependency>
            <dependency>
                <groupId>com.okta.commons</groupId>
                <artifactId>okta-http-api</artifactId>
                <version>${okta.commons.version}</version>
            </dependency>
            <dependency>
                <groupId>com.okta.commons</groupId>
                <artifactId>okta-http-httpclient</artifactId>
                <version>${okta.commons.version}</version>
            </dependency>
            <dependency>
                <groupId>com.okta.commons</groupId>
                <artifactId>okta-http-okhttp</artifactId>
                <version>${okta.commons.version}</version>
            </dependency>
            <dependency>
                <groupId>javax.annotation</groupId>
                <artifactId>javax.annotation-api</artifactId>
                <version>1.3.2</version>
            </dependency>

            <!-- ITs -->
            <dependency>
                <groupId>com.okta.idx.sdk</groupId>
                <artifactId>okta-idx-java-integration-tests</artifactId>
                <version>${project.version}</version>
            </dependency>

            <!-- Examples -->
            <dependency>
                <groupId>com.okta.idx.sdk</groupId>
                <artifactId>okta-idx-java-examples</artifactId>
                <version>${project.version}</version>
            </dependency>

            <!-- Logging -->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>jcl-over-slf4j</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>1.2.2</version>
            </dependency>

            <dependency>
                <groupId>org.testng</groupId>
                <artifactId>testng</artifactId>
                <version>${testng.version}</version>
                <scope>test</scope>
                <exclusions>
                    <exclusion>
                        <groupId>org.beanshell</groupId>
                        <artifactId>bsh</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>3.1.0</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-simple</artifactId>
                <version>${slf4j.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>

        <!-- Test dependencies -->
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <trimStackTrace>false</trimStackTrace>
                        <reuseForks>true</reuseForks>
                        <forkCount>1</forkCount>
                        <argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine>
<!--                        <parallel>classesAndMethods</parallel>-->
<!--                        <threadCount>5</threadCount>-->
<!--                        <skipTests>${skipImplTests}</skipTests>-->
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <configuration>
                        <trimStackTrace>false</trimStackTrace>
                        <reuseForks>true</reuseForks>
<!--                        <forkCount>2C</forkCount>-->
<!--                        <parallel>classes</parallel>-->
<!--                        <threadCount>5</threadCount>-->
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-pmd-plugin</artifactId>
                    <configuration>
                        <rulesets>
                            <!-- starting from maven 3.3.1 -->
                            <!--suppress UnresolvedMavenProperty -->
                            <ruleset>${maven.multiModuleProjectDirectory}/src/pmd/ruleset.xml</ruleset>
                        </rulesets>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>default-prepare-agent</id>
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>jacoco-report</id>
                            <phase>test</phase>
                            <goals>
                                <goal>report</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <excludes>
                            <exclude>**/examples/**/*</exclude>
                        </excludes>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.owasp</groupId>
                    <artifactId>dependency-check-maven</artifactId>
                    <configuration>
                        <!-- no js is used in this project -->
                        <retireJsAnalyzerEnabled>false</retireJsAnalyzerEnabled>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>com.okta</groupId>
                    <artifactId>okta-code-snippet-maven-plugin</artifactId>
                    <configuration>
                        <sourceFile>examples/src/main/java/ReadmeSnippets.java</sourceFile>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.jasig.maven</groupId>
                <artifactId>maven-notice-plugin</artifactId>
                <inherited>false</inherited>
                <configuration>
                    <noticeTemplate>${root.dir}/src/license/NOTICE.template</noticeTemplate>
                    <licenseMapping>
                        <mapping>${root.dir}/src/license/mapping.xml</mapping>
                    </licenseMapping>
                </configuration>
                <executions>
                    <execution>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.github.siom79.japicmp</groupId>
                <artifactId>japicmp-maven-plugin</artifactId>
                <version>0.15.3</version>
                <configuration>
                    <oldVersion>
                        <dependency>
                            <groupId>${project.groupId}</groupId>
                            <artifactId>${project.artifactId}</artifactId>
                            <version>${okta.sdk.previousVersion}</version>
                            <type>jar</type>
                        </dependency>
                    </oldVersion>
                    <parameter>
                        <onlyModified>true</onlyModified>
                        <breakBuildOnBinaryIncompatibleModifications>true</breakBuildOnBinaryIncompatibleModifications>
                        <breakBuildBasedOnSemanticVersioning>true</breakBuildBasedOnSemanticVersioning>
                    </parameter>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.8</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>sonatype-nexus-staging</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>false</autoReleaseAfterClose> <!-- TODO change to true after first release -->
                    <keepStagingRepositoryOnFailure>true</keepStagingRepositoryOnFailure>
                    <keepStagingRepositoryOnCloseRuleFailure>true</keepStagingRepositoryOnCloseRuleFailure>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>pub-docs</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.okta</groupId>
                        <artifactId>okta-doclist-maven-plugin</artifactId>
                        <configuration>
                            <legacyVersions>
                                <legacyVersion>0.0.4</legacyVersion>
                            </legacyVersions>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-jxr-plugin</artifactId>
                        <configuration>
                            <sourcePath>${project.build.sourceDirectory}</sourcePath>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

  <scm>
    <tag>okta-idx-java-root-2.0.0</tag>
  </scm>
</project>

