<?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/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.deftdevs</groupId>
        <artifactId>bootstrapi-parent</artifactId>
        <version>1.0.0-rc7</version>
    </parent>

    <artifactId>bootstrapi-crowd-plugin</artifactId>
    <packaging>atlassian-plugin</packaging>

    <name>BootstrAPI for Crowd</name>
    <description>BootstrAPI for Crowd provides a REST API for automated configuration tasks</description>
    <url>https://github.com/deftdevs/bootstrapi</url>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:https://github.com/deftdevs/bootstrapi.git</connection>
        <developerConnection>scm:git:https://github.com/deftdevs/bootstrapi.git</developerConnection>
        <url>https://github.com/deftdevs/bootstrapi</url>
        <tag>v1.0.0-rc7</tag>
    </scm>

    <developers>
        <developer>
            <name>Patrick Hobusch</name>
            <email>patrick.hobusch@deftdevs.com</email>
            <organization>Deft Devs LLC</organization>
            <organizationUrl>https://deftdevs.com</organizationUrl>
        </developer>

        <developer>
            <name>Cosmin Vlaicu</name>
            <email>cvlaicu@aservo.com</email>
            <organization>ASERVO Software GmbH</organization>
            <organizationUrl>https://www.aservo.com</organizationUrl>
        </developer>
    </developers>

    <properties>
        <crowd.version>6.3.6</crowd.version>
        <crowd.data.version>6.3.1</crowd.data.version>
        <atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>
        <ajp.port>8409</ajp.port>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.deftdevs</groupId>
                <artifactId>bootstrapi-parent</artifactId>
                <version>${project.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>com.atlassian.crowd</groupId>
                <artifactId>crowd-api</artifactId>
                <version>${crowd.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <!-- Fix release by providing missing version from dependency management in crowd-api -->
            <dependency>
                <groupId>com.nimbusds</groupId>
                <artifactId>nimbus-jose-jwt</artifactId>
                <version>10.9</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>

        <!-- compile dependencies -->

        <dependency>
            <groupId>com.deftdevs</groupId>
            <artifactId>bootstrapi-commons</artifactId>
            <version>${project.version}</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>io.swagger.core.v3</groupId>
            <artifactId>swagger-annotations</artifactId>
            <scope>compile</scope>
        </dependency>

        <!-- behave like compile dependencies -->

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- provided dependencies -->

        <dependency>
            <groupId>com.atlassian.crowd</groupId>
            <artifactId>crowd-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.crowd</groupId>
            <artifactId>crowd-ldap</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.crowd</groupId>
            <artifactId>crowd-persistence</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.crowd</groupId>
            <artifactId>crowd-server-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.crowd</groupId>
            <artifactId>crowd-rest-plugin</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.scheduler</groupId>
            <artifactId>atlassian-scheduler-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.plugins.rest</groupId>
            <artifactId>atlassian-rest-v2-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.plugins.authentication</groupId>
            <artifactId>atlassian-authentication-plugin-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.config</groupId>
            <artifactId>atlassian-config</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.extras</groupId>
            <artifactId>atlassian-extras-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.oauth</groupId>
            <artifactId>atlassian-oauth-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.oauth</groupId>
            <artifactId>atlassian-oauth-service-provider-spi</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.oauth</groupId>
            <artifactId>atlassian-oauth-consumer-spi</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.applinks</groupId>
            <artifactId>applinks-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.applinks</groupId>
            <artifactId>applinks-spi</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.applinks</groupId>
            <artifactId>applinks-plugin</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-osgi-javaconfig</artifactId>
        </dependency>

        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>osgi.core</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>jakarta.inject</groupId>
            <artifactId>jakarta.inject-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>jakarta.validation</groupId>
            <artifactId>jakarta.validation-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>jakarta.ws.rs</groupId>
            <artifactId>jakarta.ws.rs-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>jakarta.xml.bind</groupId>
            <artifactId>jakarta.xml.bind-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- test dependencies -->

        <dependency>
            <groupId>com.deftdevs</groupId>
            <artifactId>bootstrapi-commons</artifactId>
            <version>${project.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.sun.mail</groupId>
            <artifactId>jakarta.mail</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.glassfish.jersey.core</groupId>
            <artifactId>jersey-common</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>crowd-maven-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <productVersion>${crowd.version}</productVersion>
                    <!-- the following version may only be adjusted, when a new home zip has been generated -->
                    <productDataVersion>${crowd.data.version}</productDataVersion>
                    <!-- in case new home zip should be generated, please add your executed steps to generated-test-resources.md -->
                    <productDataPath>${project.basedir}/src/test/resources/generated-test-resources.zip</productDataPath>
                    <ajpPort>${ajp.port}</ajpPort>
                    <allowGoogleTracking>false</allowGoogleTracking>
                    <enableQuickReload>true</enableQuickReload>
                    <extractDependencies>true</extractDependencies>
                    <!-- See here for an explanation of default instructions: -->
                    <!-- https://developer.atlassian.com/docs/advanced-topics/configuration-of-instructions-in-atlassian-plugins -->
                    <instructions>
                        <Atlassian-Plugin-Key>${atlassian.plugin.key}</Atlassian-Plugin-Key>
                        <Import-Package>
                            *;resolution:="optional"
                        </Import-Package>
                        <Spring-Context>*</Spring-Context>
                    </instructions>
                </configuration>
            </plugin>

            <plugin>
                <groupId>io.swagger.core.v3</groupId>
                <artifactId>swagger-maven-plugin</artifactId>
                <configuration>
                    <openapiFilePath>${basedir}/src/main/resources/openapi.yaml</openapiFilePath>
                    <resourcePackages>
                        <resourcePackage>com.deftdevs.bootstrapi.crowd.rest</resourcePackage>
                    </resourcePackages>
                    <outputPath>${project.build.directory}</outputPath>
                    <outputFormat>YAML</outputFormat>
                    <prettyPrint>true</prettyPrint>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>resolve</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.openapitools</groupId>
                <artifactId>openapi-generator-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <inputSpec>${project.build.directory}/openapi.yaml</inputSpec>
                            <generatorName>markdown</generatorName>
                            <output>${project.basedir}</output>
                            <skipValidateSpec>true</skipValidateSpec>
                            <additionalProperties>
                                <additionalProperty>specDir=src/main/resources/openapi/specs/</additionalProperty>
                                <additionalProperty>snippetDir=src/main/resources/openapi/snippets/</additionalProperty>
                            </additionalProperties>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <pushChanges>false</pushChanges>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>
