<?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>
    <parent>
        <groupId>com.atlassian.pom</groupId>
        <artifactId>public-pom</artifactId>
        <version>7.0.0</version>
    </parent>
    <groupId>com.atlassian.plugins</groupId>
    <artifactId>atlassian-plugins-webresource-parent</artifactId>
    <version>7.2.3</version>
    <packaging>pom</packaging>
    <name>Atlassian Plugins - Web Resources - Parent</name>
    <licenses>
        <license>
            <name>BSD</name>
            <url>http://opensource.org/licenses/BSD-3-Clause</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <modules>
        <module>atlassian-plugins-webresource</module>
        <module>atlassian-plugins-webresource-api</module>
        <module>atlassian-plugins-webresource-plugin</module>
        <module>atlassian-plugins-webresource-rest</module>
        <module>atlassian-plugins-webresource-spi</module>
        <module>atlassian-plugins-webresource-tests</module>
    </modules>
    <scm>
        <connection>scm:git:git@bitbucket.org:atlassian/dc-platform.git</connection>
        <developerConnection>scm:git:git@bitbucket.org:atlassian/dc-platform.git</developerConnection>
        <tag>atlassian-plugins-webresource-7.2.3</tag>
        <url>https://bitbucket.org/atlassian/dc-platform</url>
    </scm>
    <issueManagement>
        <system>JIRA</system>
        <url>https://ecosystem.atlassian.net/browse/PLUGWEB</url>
    </issueManagement>
    <ciManagement>
        <system>Bamboo</system>
        <url>https://ecosystem-bamboo.internal.atlassian.com/browse/PLUGWEBR</url>
    </ciManagement>
    <properties>
        <amps.version>9.7.0</amps.version>
        <frontend.install.cmd>install --frozen-lockfile --prefer-offline --mutex network</frontend.install.cmd>
        <frontend.maven.plugin.version>1.12.1</frontend.maven.plugin.version>
        <hamcrest.version>2.2</hamcrest.version>
        <jacoco.it.argLine />
        <jacoco.report.file>sonar-aggregator/target/site/jacoco-aggregate/jacoco.xml</jacoco.report.file>
        <jacoco.ut.argLine />
        <jacoco.version>0.8.8</jacoco.version>
        <jgrapht.version>1.4.0</jgrapht.version>
        <junit.version>4.13.2</junit.version>
        <maven.javadoc.plugin.version>3.6.3</maven.javadoc.plugin.version>
        <mockito.version>2.28.2</mockito.version>
        <node.path>${project.basedir}/.node</node.path>
        <!-- also update the `.nvmrc` file. -->
        <node.version>v16.13.2</node.version>
        <platform.version>7.1.12</platform.version>
        <skipITs>${skipTests}</skipITs>
        <skipTests>false</skipTests>
        <skipUTs>${skipTests}</skipUTs>
        <sla.api.osgi.version>4.0.0</sla.api.osgi.version>
        <sonar.coverage.exclusions>atlassian-plugins-webresource-tests/**</sonar.coverage.exclusions>
        <sourcemap.version>2.0.0</sourcemap.version>
        <swagger.generator.version>2.1.6</swagger.generator.version>
        <swagger.version>2.1.13</swagger.version>
        <urlrewritefilter.version>4.0.4</urlrewritefilter.version>
        <wrm.api.compat.version>3.0</wrm.api.compat.version>
        <yarn.version>v1.22.15</yarn.version>
        <!-- we want to catch enforcement issues in dev loop
        otherwise will only know about them on release
        when SNAPSHOT suffix is removed for the release -->
        <banVersionDeps.noFailSnapshots>false</banVersionDeps.noFailSnapshots>
    </properties>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.atlassian.platform.dependencies</groupId>
                <artifactId>platform-deprecated-public-api</artifactId>
                <version>${platform.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>com.atlassian.platform.dependencies</groupId>
                <artifactId>platform-internal-api</artifactId>
                <version>${platform.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>com.atlassian.platform.dependencies</groupId>
                <artifactId>platform-public-api</artifactId>
                <version>${platform.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>com.atlassian.platform.dependencies</groupId>
                <artifactId>platform-test-resources</artifactId>
                <version>${platform.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>com.atlassian.plugins</groupId>
                <artifactId>atlassian-plugins-webresource</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.plugins</groupId>
                <artifactId>atlassian-plugins-webresource</artifactId>
                <version>${project.version}</version>
                <type>test-jar</type>
            </dependency>
            <!-- Needs -webfragment for Conditions. Ideally, conditions should be
                 moved into plugins core as they are not webfragment-specific -->
            <dependency>
                <groupId>com.atlassian.plugins</groupId>
                <artifactId>atlassian-plugins-webresource-api</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.plugins</groupId>
                <artifactId>atlassian-plugins-webresource-plugin</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.plugins</groupId>
                <artifactId>atlassian-plugins-webresource-rest</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.hamcrest</groupId>
                        <artifactId>hamcrest-core</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.hamcrest</groupId>
                        <artifactId>hamcrest-library</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest</artifactId>
                <version>${hamcrest.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jgrapht</groupId>
                <artifactId>jgrapht-core</artifactId>
                <version>${jgrapht.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jgrapht</groupId>
                <artifactId>jgrapht-io</artifactId>
                <version>${jgrapht.version}</version>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito.version}</version>
            </dependency>
            <dependency>
                <groupId>org.tuckey</groupId>
                <artifactId>urlrewritefilter</artifactId>
                <version>${urlrewritefilter.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.atlassian.maven.plugins</groupId>
                    <artifactId>amps-maven-plugin</artifactId>
                    <version>${amps.version}</version>
                    <configuration>
                        <skipVerifyFeManifestAssociations>true</skipVerifyFeManifestAssociations>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>com.github.eirslett</groupId>
                    <artifactId>frontend-maven-plugin</artifactId>
                    <version>${frontend.maven.plugin.version}</version>
                    <configuration>
                        <yarnVersion>${yarn.version}</yarnVersion>
                        <nodeVersion>${node.version}</nodeVersion>
                        <installDirectory>${node.path}</installDirectory>
                        <npmInheritsProxyConfigFromMaven>true</npmInheritsProxyConfigFromMaven>
                        <serverId>maven-atlassian-com</serverId>
                        <nodeDownloadRoot>https://packages.atlassian.com/artifactory/nodejs-dist/</nodeDownloadRoot>
                        <yarnDownloadRoot>https://packages.atlassian.com/artifactory/yarn-dist/</yarnDownloadRoot>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <configuration>
                        <tagNameFormat>atlassian-plugins-webresource-@{project.version}</tagNameFormat>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>com.github.eirslett</groupId>
                <artifactId>frontend-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>01-install-binaries</id>
                        <goals>
                            <goal>install-node-and-yarn</goal>
                        </goals>
                        <phase>initialize</phase>
                        <inherited>false</inherited>
                    </execution>
                    <execution>
                        <id>02-install-deps</id>
                        <goals>
                            <goal>yarn</goal>
                        </goals>
                        <phase>initialize</phase>
                        <inherited>false</inherited>
                        <configuration>
                            <arguments>${frontend.install.cmd}</arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.11.0</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <configuration>
                    <skipTests>${skipTests}</skipTests>
                    <skipITs>${skipITs}</skipITs>
                </configuration>
                <executions>
                    <execution>
                        <id>run-integration-tests</id>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                        <phase>integration-test</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <systemProperties>
                        <property>
                            <name>project.version</name>
                            <value>${project.version}</value>
                        </property>
                    </systemProperties>
                    <argLine>@{jacoco.ut.argLine}  --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED</argLine>
                    <skipTests>${skipUTs}</skipTests>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.diffplug.spotless</groupId>
                <artifactId>spotless-maven-plugin</artifactId>
                <version>2.43.0</version>
                <configuration>
                    <java>
                        <palantirJavaFormat>
                            <version>2.28.0</version>
                        </palantirJavaFormat>
                        <importOrder>
                            <wildcardsLast>true</wildcardsLast>
                            <order>java|javax,lombok,org.spring|org|com|io,,com.atlassian,com.atlassian.beacon|\#,\#com.atlassian</order>
                        </importOrder>
                        <removeUnusedImports />
                    </java>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <reporting>
        <plugins>
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <reportSets>
                    <reportSet>
                        <id>default</id>
                        <reports>
                            <report>aggregate</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    </reporting>
    <profiles>
        <profile>
            <!-- I defined them here so they're separate from other properties and don't get lost in the alphabetical sort. -->
            <id>all-product-versions</id>
            <activation>
                <property>
                    <name>!refapp.version</name>
                </property>
            </activation>
            <properties>
                <bamboo.version>10.2.0</bamboo.version>
                <bitbucket.version>9.4.1</bitbucket.version>
                <confluence.version>9.2.0</confluence.version>
                <crowd.version>6.1.2</crowd.version>
                <jira.version>10.3.2</jira.version>
                <refapp.version>${platform.version}</refapp.version>
            </properties>
        </profile>
        <profile>
            <id>jacoco</id>
            <properties>
                <jacoco.include.pattern>com/atlassian/**</jacoco.include.pattern>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <argLine>@{jacoco.it.argLine}</argLine>
                            <trimStackTrace>false</trimStackTrace>
                        </configuration>
                    </plugin>
                    <!-- Code coverage -->
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>${jacoco.version}</version>
                        <executions>
                            <execution>
                                <id>agent-for-ut</id>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                                <configuration>
                                    <propertyName>jacoco.ut.argLine</propertyName>
                                    <includes>
                                        <include>${jacoco.include.pattern}</include>
                                    </includes>
                                </configuration>
                            </execution>
                            <execution>
                                <id>agent-for-it</id>
                                <goals>
                                    <goal>prepare-agent-integration</goal>
                                </goals>
                                <phase>initialize</phase>
                                <configuration>
                                    <propertyName>jacoco.it.argLine</propertyName>
                                    <includes>
                                        <include>${jacoco.include.pattern}</include>
                                    </includes>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
