<!--
  ~ Copyright 2017 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/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.okta</groupId>
        <artifactId>okta-parent</artifactId>
        <version>2</version>
        <relativePath>../okta-java-parent</relativePath>
    </parent>

    <groupId>com.okta.spring</groupId>
    <artifactId>okta-spring-boot-parent</artifactId>
    <version>0.2.0</version>
    <name>Okta Spring Boot</name>
    <packaging>pom</packaging>

    <properties>
        <spring-boot.version>1.5.7.RELEASE</spring-boot.version>
        <github.slug>okta/okta-spring-security</github.slug>
    </properties>

    <modules>
        <module>config</module>
        <module>oauth2</module>
        <module>okta-spring-boot-starter</module>
        <module>integration-tests/oauth2</module>
        <module>examples</module>
        <module>coverage</module>
    </modules>

    <dependencyManagement>
        <dependencies>

            <dependency>
                <!-- Import dependency management from Spring Boot -->
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring-boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <!-- User newer oauth2 module, this will be removed when this version is include in the above BOM  -->
            <dependency>
                <groupId>org.springframework.security.oauth</groupId>
                <artifactId>spring-security-oauth2</artifactId>
                <version>2.2.0.RELEASE</version>
                <exclusions>
                    <!-- don't let these transitive dependencies mess with the bom above -->
                    <exclusion>
                        <groupId>*</groupId>
                        <artifactId>*</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
                <exclusions>
                    <exclusion>
                        <groupId>commons-logging</groupId>
                        <artifactId>commons-logging</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <!-- this project's modules -->
            <dependency>
                <groupId>com.okta.spring</groupId>
                <artifactId>okta-spring-boot-starter</artifactId>
                <version>0.2.0</version>
            </dependency>
            <dependency>
                <groupId>com.okta.spring</groupId>
                <artifactId>okta-spring-security-oauth2</artifactId>
                <version>0.2.0</version>
            </dependency>
            <dependency>
                <groupId>com.okta.spring</groupId>
                <artifactId>okta-spring-config</artifactId>
                <version>0.2.0</version>
            </dependency>
            <dependency>
                <groupId>com.okta.spring</groupId>
                <artifactId>okta-spring-boot-integration-tests-oauth2</artifactId>
                <version>0.2.0</version>
            </dependency>

            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>2.10.0</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <profiles>
        <profile>
            <id>pub-docs</id>
            <build>

                <!-- this needs to be fixed in the parent pom -->
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-scm-publish-plugin</artifactId>
                            <version>1.1</version>
                            <configuration>
                                <checkinComment>Publishing javadoc for ${project.artifactId}:${project.version}</checkinComment>
                                <content>${gh-pages.dir}</content>
                                <skipDeletedFiles>true</skipDeletedFiles>
                                <pubScmUrl>scm:git:https://${github.api.key}@github.com/${github.slug}.git</pubScmUrl>
                                <scmBranch>gh-pages</scmBranch> <!-- branch with static site -->
                                <checkoutDirectory>${project.build.directory}/scmpublish-checkout-javadoc</checkoutDirectory>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
                <!-- end fix in parent -->

                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-scm-publish-plugin</artifactId>
                        <version>1.1</version>
                        <inherited>false</inherited>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

  <scm>
    <tag>okta-spring-boot-parent-0.2.0</tag>
  </scm>
</project>