<?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.atlassian.pom</groupId>
        <artifactId>closedsource-pom</artifactId>
        <version>6.0.2</version>
    </parent>

    <organization>
        <name>Atlassian</name>
        <url>https://www.atlassian.com/</url>
    </organization>
    <name>Bitbucket Cloud Migration Assistant Parent POM</name>
    <description>Bitbucket Cloud Migration Assistant Parent POM</description>

    <groupId>com.atlassian.bitbucket.plugin.bcma</groupId>
    <artifactId>bitbucket-migration-plugin-parent</artifactId>
    <version>1.3.95</version>
    <packaging>pom</packaging>

    <modules>
        <module>bitbucket-migration-plugin</module>
        <module>bitbucket-migration-test-plugin</module>
    </modules>

    <scm>
        <connection>scm:git:ssh://git@bitbucket.org/bitbucket/bitbucket-migration-plugin.git</connection>
        <developerConnection>
            scm:git:ssh://git@bitbucket.org/bitbucket/bitbucket-migration-plugin.git
        </developerConnection>
        <url>https://bitbucket.org/bitbucket/bitbucket-migration-plugin</url>
        <tag>bitbucket-migration-plugin-parent-1.3.95</tag>
    </scm>

    <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <atlassian.osgi.javaconfig.version>0.2.0</atlassian.osgi.javaconfig.version>
        <atlassian.rest.common.version>3.4.12</atlassian.rest.common.version>
        <amps.version>8.0.4</amps.version>
        <bitbucket.compile.version>7.17.7</bitbucket.compile.version>
        <bitbucket.version>7.10.0</bitbucket.version>
        <bitbucket.data.version>${bitbucket.version}</bitbucket.data.version>
        <atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>
        <javax.inject.version>1</javax.inject.version>
        <plugin.testrunner.version>2.0.2</plugin.testrunner.version>
        <mockk.version>1.12.2</mockk.version>
        <org.junit.jupiter.version>5.8.2</org.junit.jupiter.version>
        <org.junit.platform.version>1.8.2</org.junit.platform.version>
        <assertj-core.version>3.22.0</assertj-core.version>
        <kotlin.version>1.6.10</kotlin.version>
        <kotlin.compiler.incremental>true</kotlin.compiler.incremental>
        <cmpt.shared.library.version>3.0.1</cmpt.shared.library.version>
        <jackson.version>2.13.4</jackson.version>
        <jackson.databind.version>2.13.4.2</jackson.databind.version>
        <app.cloud.migration.osgi.version>1.0.0</app.cloud.migration.osgi.version>
        <app.migration.assistant.version>1.5.5</app.migration.assistant.version>
        <pocketknife.querydsl.version>5.0.4</pocketknife.querydsl.version>
        <sonar.maven.plugin.version>3.9.1.2184</sonar.maven.plugin.version>
        <maven.clean.plugin.version>3.1.0</maven.clean.plugin.version>
        <maven.resources.plugin.version>3.2.0</maven.resources.plugin.version>
        <frontend.maven.plugin.version>1.12.1</frontend.maven.plugin.version>
        <bitbucket-migration-datatypes.version>0.0.20</bitbucket-migration-datatypes.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.atlassian.bitbucket.server</groupId>
                <artifactId>bitbucket-parent</artifactId>
                <version>${bitbucket.compile.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!-- This dependency has been included in the pom file bitbucket as 1.8
             however to fix VUL ticket we need to changed it here if we don't want to wait for BBS -->
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-text</artifactId>
                <version>1.10.0</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.jetbrains.kotlin</groupId>
                    <artifactId>kotlin-maven-plugin</artifactId>
                    <version>${kotlin.version}</version>
                </plugin>
                <plugin>
                    <groupId>com.atlassian.maven.plugins</groupId>
                    <artifactId>bitbucket-maven-plugin</artifactId>
                    <version>${amps.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.22.2</version>
                    <configuration>
                        <useSystemClassLoader>false</useSystemClassLoader>
                        <excludes>
                            <!-- But we also have to do our own exclusions because the parent pom doesn't know what's up  -->
                            <exclude>%regex[it[/\\].*]</exclude>
                            <exclude>**/*$*</exclude>
                        </excludes>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>2.22.2</version>
                    <configuration>
                        <useSystemClassLoader>false</useSystemClassLoader>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.sonarsource.scanner.maven</groupId>
                    <artifactId>sonar-maven-plugin</artifactId>
                    <version>${sonar.maven.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>3.0.0-atlassian-m01</version>
                    <executions>
                        <execution>
                            <id>enforce-build-environment</id>
                            <phase>compile</phase>
                            <configuration>
                                <rules>
                                    <banDuplicatePomDoependencies />
                                </rules>
                            </configuration>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>1.8</version>
                    <executions>
                        <execution>
                            <id>ktlint</id>
                            <phase>validate</phase>
                            <configuration>
                                <target name="ktlint">
                                    <java taskname="ktlint" dir="${basedir}" fork="true" failonerror="true" classname="com.pinterest.ktlint.Main" classpathref="maven.plugin.classpath">
                                        <arg value="src/**/*.kt" />
                                    </java>
                                </target>
                                <skip>${skipTests}</skip>
                            </configuration>
                            <goals>
                                <goal>run</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>ktlint-format</id>
                            <configuration>
                                <target name="ktlint">
                                    <java taskname="ktlint" dir="${basedir}" fork="true" failonerror="true" classname="com.pinterest.ktlint.Main" classpathref="maven.plugin.classpath">
                                        <arg value="-F" />
                                        <arg value="src/**/*.kt" />
                                    </java>
                                </target>
                            </configuration>
                            <goals>
                                <goal>run</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>ktlint-intellij-config</id>
                            <configuration>
                                <target name="ktlint">
                                    <java taskname="ktlint" dir="${basedir}" fork="true" failonerror="true" classname="com.pinterest.ktlint.Main" classpathref="maven.plugin.classpath">
                                        <arg value="applyToIDEAProject" />
                                        <arg value="-y" />
                                    </java>
                                </target>
                            </configuration>
                            <goals>
                                <goal>run</goal>
                            </goals>
                        </execution>
                    </executions>
                    <dependencies>
                        <dependency>
                            <groupId>com.pinterest</groupId>
                            <artifactId>ktlint</artifactId>
                            <version>0.43.0</version>
                        </dependency>
                        <!-- additional 3rd party ruleset(s) can be specified here -->
                    </dependencies>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
</project>
