<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2018-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.commons</groupId>
    <artifactId>okta-commons-root</artifactId>
    <version>1.3.0</version>
    <packaging>pom</packaging>

    <name>Okta Commons</name>
    <description>Common modules used by Okta SDKs and integrations</description>
    <url>https://github.com/okta/okta-commons-java</url>
    <inceptionYear>2018</inceptionYear>

    <properties>
        <github.slug>okta/okta-commons-java</github.slug>
        <okta.commons.previousVersion>1.2.8</okta.commons.previousVersion>
        <kotlin.lib.version>1.6.0</kotlin.lib.version>
    </properties>

    <modules>
        <module>config-check</module>
        <module>lang</module>
        <module>http/http-api</module>
        <module>http/okhttp</module>
        <module>http/httpclient</module>
        <module>coverage</module>
    </modules>

    <dependencyManagement>
        <dependencies>

            <!-- child projects -->
            <dependency>
                <groupId>com.okta.commons</groupId>
                <artifactId>okta-commons-lang</artifactId>
                <version>1.3.0</version>
            </dependency>
            <dependency>
                <groupId>com.okta.commons</groupId>
                <artifactId>okta-config-check</artifactId>
                <version>1.3.0</version>
            </dependency>
            <dependency>
                <groupId>com.okta.commons</groupId>
                <artifactId>okta-http-api</artifactId>
                <version>1.3.0</version>
            </dependency>
            <dependency>
                <groupId>com.okta.commons</groupId>
                <artifactId>okta-http-okhttp</artifactId>
                <version>1.3.0</version>
            </dependency>
            <dependency>
                <groupId>com.okta.commons</groupId>
                <artifactId>okta-http-httpclient</artifactId>
                <version>1.3.0</version>
            </dependency>

            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-stdlib</artifactId>
                <version>${kotlin.lib.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-stdlib-common</artifactId>
                <version>${kotlin.lib.version}</version>
            </dependency>

            <dependency>
                <!-- compile time annotation processor -->
                <groupId>com.google.auto.service</groupId>
                <artifactId>auto-service</artifactId>
                <version>1.0</version>
                <optional>true</optional>
            </dependency>

            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>java-hamcrest</artifactId>
                <version>2.0.0.0</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>java-hamcrest</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <configuration>
                        <archive>
                            <manifestEntries>
                                <Automatic-Module-Name>${module.name}</Automatic-Module-Name>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-pmd-plugin</artifactId>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <configuration>
                        <!-- exclude generated enums coverage -->
                        <excludes>
                            <exclude>**/com/okta/sdk/resource/**/*</exclude>
                            <exclude>**/quickstart/**/*</exclude>
                        </excludes>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>com.github.siom79.japicmp</groupId>
                    <artifactId>japicmp-maven-plugin</artifactId>
                    <version>0.15.4</version>
                    <configuration>
                        <oldVersion>
                            <dependency>
                                <groupId>${project.groupId}</groupId>
                                <artifactId>${project.artifactId}</artifactId>
                                <version>${okta.commons.previousVersion}</version>
                                <type>jar</type>
                            </dependency>
                        </oldVersion>
                        <parameter>
                            <onlyModified>true</onlyModified>
                            <breakBuildOnBinaryIncompatibleModifications>true</breakBuildOnBinaryIncompatibleModifications>
                            <breakBuildBasedOnSemanticVersioning>true</breakBuildBasedOnSemanticVersioning>
                        </parameter>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>jacoco-report</id>
                        <goals>
                            <goal>report</goal>
                        </goals>
                        <phase>verify</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jasig.maven</groupId>
                <artifactId>maven-notice-plugin</artifactId>
                <inherited>false</inherited>
                <configuration>
                    <noticeTemplate>${root.dir}/src/license/NOTICE.template</noticeTemplate>
                </configuration>
                <executions>
                    <execution>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>ci</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.github.siom79.japicmp</groupId>
                        <artifactId>japicmp-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>japicmp</id>
                                <goals>
                                    <goal>cmp</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>pub-docs</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.okta</groupId>
                        <artifactId>okta-doclist-maven-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-jxr-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

  <scm>
    <tag>okta-commons-root-1.3.0</tag>
  </scm>
</project>
