<?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>91</version>
    </parent>

    <artifactId>scriptrunner-bitbucket-base</artifactId>
    <version>91</version>

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

    <properties>
        <scriptrunner.version>9.33.0</scriptrunner.version> <!-- ScriptRunner for Bitbucket -->

        <bitbucket.version>9.0.0</bitbucket.version>

        <bitbucket.host>${product.host}</bitbucket.host>
        <bitbucket.port>${product.port}</bitbucket.port>
    </properties>

    <modules>
        <module>bitbucket-standard</module>
    </modules>

    <dependencies>
        <dependency>
            <groupId>com.onresolve.stash.groovy</groupId>
            <artifactId>groovyrunner</artifactId>
            <version>${scriptrunner.version}</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.atlassian.bitbucket.server</groupId>
            <artifactId>bitbucket-api</artifactId>
            <version>${bitbucket.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.bitbucket.server</groupId>
            <artifactId>bitbucket-spi</artifactId>
            <version>${bitbucket.version}</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.atlassian.maven.plugins</groupId>
                    <artifactId>bitbucket-maven-plugin</artifactId>
                    <version>${amps.version}</version>
                    <extensions>true</extensions>
                    <configuration>
                        <skipAmpsPomCheck>true</skipAmpsPomCheck>
                        <skipAllPrompts>true</skipAllPrompts>
                        <extractDependencies>false</extractDependencies>
                        <allowGoogleTracking>false</allowGoogleTracking>
                        <enableQuickReload>true</enableQuickReload>

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

                        <pluginArtifacts>
                            <pluginArtifact>
                                <groupId>com.onresolve.stash.groovy</groupId>
                                <artifactId>groovyrunner</artifactId>
                                <version>${scriptrunner.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>
                        </systemPropertyVariables>

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

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

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