<?xml version="1.0" encoding="UTF-8"?>

<!--
  ~ Copyright 2019-2020 TNG Technology Consulting GmbH
  ~
  ~ SPDX-License-Identifier: Apache-2.0
  -->

<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.tngtech.atlassian</groupId>
        <artifactId>base-pom</artifactId>
        <version>3.6.2</version>
    </parent>

    <artifactId>refapp-pom</artifactId>
    <version>3.6.2</version>
    <packaging>pom</packaging>
    <licenses>
        <license>
            <name>Apache-2.0</name>
        </license>
    </licenses>

    <organization>
        <name>TNG Technology Consulting</name>
        <url>http://www.tngtech.com/atlassian</url>
    </organization>

    <name>TNG's Atlassian Refapp POM</name>
    <description>POM contains TNG's Refapp specific configuration like Maven repositories and standard maven plugins.
    </description>

    <properties>
        <refapp.version>5.2.3</refapp.version>
        <refapp.data.version>${refapp.version}</refapp.data.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.atlassian.refapp</groupId>
                <artifactId>atlassian-refapp-parent</artifactId>
                <version>${refapp.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>
            <dependency>
                <groupId>com.atlassian.refapp</groupId>
                <artifactId>refapp-api</artifactId>
                <version>${refapp.version}</version>
                <scope>provided</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.atlassian.maven.plugins</groupId>
                    <artifactId>refapp-maven-plugin</artifactId>
                    <version>${amps.version}</version>
                    <extensions>true</extensions>
                    <configuration>
                        <productVersion>${refapp.version}</productVersion>
                        <productDataVersion>${refapp.data.version}</productDataVersion>
                        <enableQuickReload>true</enableQuickReload>
                        <compressResources>true</compressResources>
                        <extractDependencies>false</extractDependencies>
                        <jvmArgs>${jvm.args}</jvmArgs>
                        <skipManifestValidation>true</skipManifestValidation>

                        <testGroups>
                            <testGroup>
                                <id>wired-integration</id>
                                <productIds>
                                    <productId>refapp</productId>
                                </productIds>
                                <includes>
                                    <include>it/**/*.java</include>
                                </includes>
                            </testGroup>
                        </testGroups>

                        <!-- 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>

                            <!-- Add package import here -->
                            <Import-Package>
                                *
                            </Import-Package>

                            <!-- Ensure plugin is spring powered -->
                            <Spring-Context>*</Spring-Context>
                        </instructions>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>refapp-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>ao-tests</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.atlassian.maven.plugins</groupId>
                        <artifactId>refapp-maven-plugin</artifactId>
                        <configuration>
                            <skipUTs>true</skipUTs>
                            <skipAmpsPomCheck>true</skipAmpsPomCheck>
                            <skipBanningDependencies>true</skipBanningDependencies>
                            <skipManifestValidation>true</skipManifestValidation>
                            <skipRestDocGeneration>true</skipRestDocGeneration>
                            <skipMinifiedJs>true</skipMinifiedJs>
                            <noWebapp>true</noWebapp>
                            <testGroups>
                                <testGroup>
                                    <includes>
                                        <include>${includeAOsPattern}</include>
                                    </includes>
                                </testGroup>
                            </testGroups>
                            <systemPropertyVariables>
                                <ao.transaction.isolation.level>TRANSACTION_READ_COMMITTED</ao.transaction.isolation.level>
                                <db.schema>${db.schema}</db.schema>
                                <db.url>${db.url}</db.url>
                                <db.username>${db.username}</db.username>
                                <db.password>${db.password}</db.password>
                            </systemPropertyVariables>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
