<?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>de.aservo</groupId>
        <artifactId>parent-pom</artifactId>
        <version>0.0.11</version>
    </parent>

    <artifactId>confapi-crowd-plugin</artifactId>
    <version>0.3.1</version>
    <packaging>atlassian-plugin</packaging>

    <name>ConfAPI for Crowd</name>
    <description>ConfAPI for Crowd provides a REST API for automated configuration tasks.</description>
    <url>https://github.com/aservo/confapi-crowd-plugin</url>

    <organization>
        <name>ASERVO Software GmbH</name>
        <url>https://www.aservo.com</url>
    </organization>

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

    <issueManagement>
        <system>Github</system>
        <url>https://github.com/aservo/confapi-crowd-plugin/issues</url>
    </issueManagement>

    <scm>
        <connection>scm:git:git@github.com:aservo/confapi-crowd-plugin.git</connection>
        <developerConnection>scm:git:git@github.com:aservo/confapi-crowd-plugin.git</developerConnection>
        <url>https://github.com/aservo/confapi-crowd-plugin</url>
        <tag>v@{project.version}</tag>
    </scm>

    <developers>
        <developer>
            <name>Patrick Hobusch</name>
            <email>phobusch@aservo.com</email>
            <organization>ASERVO Software GmbH</organization>
            <organizationUrl>https://www.aservo.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>5.1.3</crowd.version>
        <crowd.data.version>4.4.0</crowd.data.version>
        <ajp.port>8409</ajp.port>
        <amps.version>8.0.2</amps.version>
        <atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>
        <atlassian.spring.scanner.version>2.1.5</atlassian.spring.scanner.version>
        <confapi-commons.version>0.2.0</confapi-commons.version>
        <plugin.testrunner.version>2.0.1</plugin.testrunner.version>
        <!-- Compiler must be 8 so that the plugin can run on Crowd instances using Java 8 -->
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    </properties>

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

            <dependency>
                <groupId>de.aservo</groupId>
                <artifactId>confapi-commons</artifactId>
                <version>${confapi-commons.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>

        <!-- compile dependencies -->

        <dependency>
            <groupId>de.aservo</groupId>
            <artifactId>confapi-commons</artifactId>
            <version>${confapi-commons.version}</version>
            <scope>compile</scope>
        </dependency>

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

        <!-- behaves like a compile dependency -->

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.28</version>
            <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-core</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-quartz1</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.plugin</groupId>
            <artifactId>atlassian-spring-scanner-annotation</artifactId>
            <version>${atlassian.spring.scanner.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.plugins.rest</groupId>
            <artifactId>atlassian-rest-common</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>javax.ws.rs</groupId>
            <artifactId>javax.ws.rs-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax.inject</groupId>
            <artifactId>javax.inject</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.7.9</version>
            <scope>provided</scope>
        </dependency>

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

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

        <!-- test dependencies -->

        <dependency>
            <groupId>de.aservo</groupId>
            <artifactId>confapi-commons</artifactId>
            <version>${confapi-commons.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.2</version>
            <scope>test</scope>
        </dependency>

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

        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-core</artifactId>
            <version>1.3</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.wink</groupId>
            <artifactId>wink-client</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.crowd</groupId>
            <artifactId>crowd-test-utils</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-osgi-testrunner</artifactId>
            <version>${plugin.testrunner.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>junit</groupId>
                    <artifactId>junit</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>junit</groupId>
                    <artifactId>junit-dep</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>crowd-maven-plugin</artifactId>
                <version>${amps.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <ajpPort>${ajp.port}</ajpPort>
                    <productVersion>${crowd.version}</productVersion>
                    <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>
                    <allowGoogleTracking>false</allowGoogleTracking>
                    <enableQuickReload>true</enableQuickReload>
                    <extractDependencies>true</extractDependencies>
                    <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>com.atlassian.plugin</groupId>
                <artifactId>atlassian-spring-scanner-maven-plugin</artifactId>
                <version>${atlassian.spring.scanner.version}</version>
                <executions>
                    <execution>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>atlassian-spring-scanner</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <scannedDependencies>
                        <dependency>
                            <groupId>com.atlassian.plugin</groupId>
                            <artifactId>atlassian-spring-scanner-external-jar</artifactId>
                        </dependency>
                    </scannedDependencies>
                    <verbose>false</verbose>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.21.0</version>
                <configuration>
                    <redirectTestOutputToFile>true</redirectTestOutputToFile>
                </configuration>
            </plugin>

            <plugin>
                <groupId>io.swagger.core.v3</groupId>
                <artifactId>swagger-maven-plugin</artifactId>
                <version>${swagger.version}</version>
                <configuration>
                    <openapiFilePath>${basedir}/src/main/resources/openapi.yaml</openapiFilePath>
                    <resourcePackages>
                        <resourcePackage>de.aservo.confapi.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>
                <version>${openapi-generator-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <inputSpec>${project.build.directory}/openapi.yaml</inputSpec>
                            <generatorName>asciidoc</generatorName>
                            <output>${project.basedir}</output>
                            <skipValidateSpec>true</skipValidateSpec>
                            <additionalProperties>specDir=src/main/resources/doc/</additionalProperties>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- Override Nexus Staging version from parent pom -->
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.13</version>
            </plugin>
        </plugins>
    </build>

</project>
