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

    <modelVersion>4.0.0</modelVersion>
    <packaging>pom</packaging>

    <parent>
        <groupId>com.adaptavist.pom</groupId>
        <artifactId>scriptrunner-base</artifactId>
        <version>48</version>
    </parent>

    <artifactId>scriptrunner-confluence-base</artifactId>
    <version>48</version>

    <name>ScriptRunner for Confluence - base plugin pom</name>
    <description>Base pom for ScriptRunner for Confluence script plugins.</description>

    <modules>
        <module>confluence-standard</module>
    </modules>

    <properties>
        <scriptrunner.version>8.3.0</scriptrunner.version> <!-- ScriptRunner for Confluence -->

        <confluence.version>7.12.0</confluence.version>
        <confluence.host>${product.host}</confluence.host>
        <confluence.port>${product.port}</confluence.port>

        <logging.levels>com.onresolve;DEBUG</logging.levels>

        <!-- Dependency Versions -->
        <logging-assistant.version>1.0.0</logging-assistant.version>
        <enforcer.fail>false</enforcer.fail>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.onresolve.confluence.groovy</groupId>
            <artifactId>groovyrunner</artifactId>
            <version>${scriptrunner.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.confluence</groupId>
            <artifactId>confluence</artifactId>
            <version>${confluence.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.adaptavist</groupId>
            <artifactId>logging-assistant</artifactId>
            <version>${logging-assistant.version}</version>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.atlassian.maven.plugins</groupId>
                    <artifactId>confluence-maven-plugin</artifactId>
                    <version>${amps.version}</version>
                    <extensions>true</extensions>
                    <configuration>
                        <jvmArgs>-Xms512m -Xmx2g -XX:MaxPermSize=1g -XX:-UseGCOverheadLimit -server</jvmArgs>
                        <skipAmpsPomCheck>true</skipAmpsPomCheck>
                        <skipAllPrompts>true</skipAllPrompts>
                        <extractDependencies>false</extractDependencies>
                        <allowGoogleTracking>false</allowGoogleTracking>
                        <enableQuickReload>true</enableQuickReload>

                        <productVersion>${confluence.version}</productVersion>
                        <productDataVersion>${confluence.version}</productDataVersion>
                        <server>${confluence.host}</server>
                        <httpPort>${confluence.port}</httpPort>

                        <pluginArtifacts>
                            <pluginArtifact>
                                <groupId>com.onresolve.confluence.groovy</groupId>
                                <artifactId>groovyrunner</artifactId>
                                <version>${scriptrunner.version}</version>
                            </pluginArtifact>

                            <pluginArtifact>
                                <groupId>com.adaptavist</groupId>
                                <artifactId>logging-assistant</artifactId>
                                <version>${logging-assistant.version}</version>
                            </pluginArtifact>
                        </pluginArtifacts>

                        <systemPropertyVariables>
                            <atlassian.dev.mode>${dev.mode}</atlassian.dev.mode>
                            <plugin.script.roots>${plugin.script.roots}</plugin.script.roots>
                            <plugin.script.test.packages>${plugin.script.test.packages}</plugin.script.test.packages>
                            <loggingLevels>${logging.levels}</loggingLevels>
                        </systemPropertyVariables>

                        <instructions>
                            <Import-Package>
                                *;resolution:="optional"
                            </Import-Package>

                            <!-- Ensure plugin is spring powered -->
                            <Spring-Context>*</Spring-Context>

                            <Require-Bundle>
                                com.onresolve.confluence.groovy.groovyrunner
                            </Require-Bundle>
                        </instructions>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
</project>
