<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2017-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>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>9</version>
    </parent>

    <groupId>com.okta</groupId>
    <artifactId>okta-aggregator</artifactId>
    <version>32</version>
    <packaging>pom</packaging>

    <name>Okta OSS Root POM</name>
    <description>Okta OSS Root POM</description>
    <url>https://github.com/okta/okta-java-parent</url>
    <organization>
        <name>Okta</name>
        <url>http://developer.okta.com/</url>
    </organization>
    <inceptionYear>2017</inceptionYear>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <!-- real base dir -->
        <root.dir>${session.executionRootDirectory}</root.dir>

        <!-- github -->
        <github.slug>okta/okta-java-parent</github.slug>
    </properties>

    <licenses>
        <license>
            <name>The Apache License, Version 2.0</name>
            <url>https://github.com/okta/okta-sdk-java/blob/master/LICENSE</url>
        </license>
    </licenses>
    
    <developers>
        <developer>
            <name>Okta</name>
            <email>developers@okta.com</email>
            <organization>Okta</organization>
            <organizationUrl>https://www.okta.com</organizationUrl>
        </developer>
    </developers>
    
    <scm>
        <connection>scm:git:git://github.com/okta/${github.slug}.git</connection>
        <developerConnection>scm:git:ssh://github.com:${github.slug}.git</developerConnection>
        <url>http://github.com/${github.slug}/tree/master</url>
      <tag>okta-aggregator-32</tag>
  </scm>

    <modules>
        <module>build-support</module>
        <module>parent</module>
        <module>doclist-plugin</module>
        <module>code-snippet-plugin</module>
    </modules>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.4.1</version>
                <executions>
                    <execution>
                        <id>enforce-versions</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <message>You are running an older version of Maven. This project requires at least Maven 3.3.9</message>
                                    <version>[3.3.9,)</version>
                                </requireMavenVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.7.0</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>sonatype-nexus-staging</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                    <keepStagingRepositoryOnFailure>true</keepStagingRepositoryOnFailure>
                    <keepStagingRepositoryOnCloseRuleFailure>true</keepStagingRepositoryOnCloseRuleFailure>
                </configuration>
            </plugin>
        </plugins>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>3.1.0</version>
                    <configuration>
                        <!-- do not update upstream, with a pending release. -->
                        <pushChanges>false</pushChanges>
                        <localCheckout>true</localCheckout>
                        <!-- scan with OWASP plugin before release -->
                        <preparationGoals>clean verify dependency-check:aggregate</preparationGoals>
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                        <!-- This configuration copied from apache:apache:7 parent pom -->
                        <useReleaseProfile>false</useReleaseProfile>
                        <goals>deploy</goals>
                        <mavenExecutorId>forked-path</mavenExecutorId>
                        <arguments>-Pdocs,okta-signature</arguments>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.apache.maven.scm</groupId>
                            <artifactId>maven-scm-provider-gitexe</artifactId>
                            <version>2.1.0</version>
                        </dependency>
                        <dependency>
                            <groupId>org.apache.maven.scm</groupId>
                            <artifactId>maven-scm-api</artifactId>
                            <version>2.1.0</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>org.owasp</groupId>
                    <artifactId>dependency-check-maven</artifactId>
                    <version>9.2.0</version>
                    <configuration>
                        <suppressionFile>${root.dir}/src/owasp/owasp-suppression.xml</suppressionFile>
                        <failBuildOnAnyVulnerability>true</failBuildOnAnyVulnerability>
                        <name>OWASP Dependency Check</name>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>versions-maven-plugin</artifactId>
                    <version>2.16.2</version>
                    <configuration>
                        <generateBackupPoms>false</generateBackupPoms>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>io.snyk</groupId>
                    <artifactId>snyk-maven-plugin</artifactId>
                    <version>2.2.0</version>
                    <configuration>
                        <apiToken>${env.SNYK_API_TOKEN}</apiToken>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>okta-signature</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.2.4</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
