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

    <groupId>com.atlassian.plugins</groupId>
    <artifactId>static-assets-url</artifactId>
    <version>1.0.5</version>

    <organization>
        <name>Atlassian</name>
        <url>http://www.atlassian.com/</url>
    </organization>

    <name>Static Assets (CDN) Plugin</name>
    <description>
        This is the Static Assets plugin for Atlassian products.
        Provides support for adding CDN and caching functionality for static assets.
    </description>
    <packaging>atlassian-plugin</packaging>

    <scm>
        <connection>scm:git:ssh://git@stash.atlassian.com:7997/cp/static-assets-url.git</connection>
        <developerConnection>scm:git:ssh://git@stash.atlassian.com:7997/cp/static-assets-url.git</developerConnection>
        <url>https://stash.atlassian.com/projects/CP/repos/static-assets-url/</url>
        <tag>static-assets-url-1.0.5</tag>
    </scm>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.atlassian.platform</groupId>
                <artifactId>platform</artifactId>
                <version>${platform.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>com.atlassian.platform</groupId>
                <artifactId>third-party</artifactId>
                <version>${platform.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-webresource</artifactId>
            <version>${webresource.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-core</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.event</groupId>
            <artifactId>atlassian-event</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.analytics</groupId>
            <artifactId>analytics-client-lib</artifactId>
            <version>${analytics.version}</version>
            <scope>provided</scope>
        </dependency>

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

        <dependency>
            <groupId>com.atlassian.plugins.rest</groupId>
            <artifactId>atlassian-rest-common</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.plugin</groupId>
            <artifactId>atlassian-spring-scanner-annotation</artifactId>
            <version>${atlassian.spring.scanner.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.soy</groupId>
            <artifactId>soy-template-renderer-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.cache</groupId>
            <artifactId>atlassian-cache-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.gadgets</groupId>
            <artifactId>atlassian-gadgets-api</artifactId>
            <version>4.3.9</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax.inject</groupId>
            <artifactId>javax.inject</artifactId>
            <version>1</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- Test dependencies -->

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>rest-assured</artifactId>
            <version>${rest.assured.version}</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>com.github.eirslett</groupId>
                <artifactId>frontend-maven-plugin</artifactId>
                <version>${frontend.maven.plugin.version}</version>
                <configuration>
                    <installDirectory>${project.build.directory}</installDirectory>
                    <workingDirectory>${project.basedir}</workingDirectory>
                    <nodeVersion>${node.version}</nodeVersion>
                    <yarnVersion>${yarn.version}</yarnVersion>
                    <installDirectory>${node.path}</installDirectory>
                    <npmInheritsProxyConfigFromMaven>true</npmInheritsProxyConfigFromMaven>
                </configuration>
                <executions>
                    <execution>
                        <id>install node and yarn</id>
                        <goals>
                            <goal>install-node-and-yarn</goal>
                        </goals>
                        <phase>initialize</phase>
                        <inherited>false</inherited>
                    </execution>
                    <execution>
                        <id>yarn install</id>
                        <goals>
                            <goal>yarn</goal>
                        </goals>
                        <configuration>
                            <arguments>${frontend.install.cmd}</arguments>
                        </configuration>
                        <phase>initialize</phase>
                        <inherited>false</inherited>
                    </execution>
                    <execution>
                        <id>webpack build</id>
                        <goals>
                            <goal>yarn</goal>
                        </goals>
                        <configuration>
                            <arguments>${yarn.build}</arguments>
                        </configuration>
                        <phase>process-resources</phase>
                    </execution>
                    <execution>
                        <id>install-dev-dependencies</id>
                        <phase>test</phase>
                        <goals>
                            <goal>yarn</goal>
                        </goals>
                        <configuration>
                            <arguments>${frontend.install.cmd.dev}</arguments>
                            <skip>${skipTests}</skip>
                        </configuration>
                    </execution>
                    <execution>
                        <id>verify lint config</id>
                        <phase>test</phase>
                        <goals>
                            <goal>yarn</goal>
                        </goals>
                        <configuration>
                            <arguments>lint:config:check</arguments>
                            <skip>${skipTests}</skip>
                        </configuration>
                    </execution>
                    <execution>
                        <id>run-lint</id>
                        <phase>test</phase>
                        <goals>
                            <goal>yarn</goal>
                        </goals>
                        <configuration>
                            <arguments>lint</arguments>
                            <skip>${skipTests}</skip>
                        </configuration>
                    </execution>
                    <execution>
                        <id>run-tests</id>
                        <phase>test</phase>
                        <goals>
                            <goal>yarn</goal>
                        </goals>
                        <configuration>
                            <arguments>test</arguments>
                            <skip>${skipTests}</skip>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>amps-maven-plugin</artifactId>
                <version>${amps.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <allowGoogleTracking>false</allowGoogleTracking>
                    <enableQuickReload>true</enableQuickReload>
                    <compressJs>false</compressJs>
                    <instructions>
                        <Atlassian-Plugin-Key>${atlassian.plugin.key}</Atlassian-Plugin-Key>
                        <Atlassian-Scan-Folders>META-INF/plugin-descriptors</Atlassian-Scan-Folders>
                        <Spring-Context>*</Spring-Context>
                        <Export-Package />
                        <Import-Package>*</Import-Package>
                    </instructions>
                    <skipManifestValidation>true</skipManifestValidation>
                    <products>
                        <product>
                            <id>jira</id>
                            <version>${jira.version}</version>
                        </product>
                        <product>
                            <id>confluence</id>
                            <version>${confluence.version}</version>
                        </product>
                    </products>
                    <testGroups>
                        <testGroup>
                            <id>confluence</id>
                            <productIds>
                                <productId>confluence</productId>
                            </productIds>
                        </testGroup>
                        <testGroup>
                            <id>jira</id>
                            <productIds>
                                <productId>jira</productId>
                            </productIds>
                        </testGroup>
                    </testGroups>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.atlassian.plugin</groupId>
                <artifactId>atlassian-spring-scanner-maven-plugin</artifactId>
                <version>${atlassian.spring.scanner.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>atlassian-spring-scanner</goal>
                        </goals>
                        <phase>process-classes</phase>
                    </execution>
                </executions>
                <configuration>
                    <verbose>false</verbose>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>node_modules</directory>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>dev.mode</id>
            <properties>
                <frontend.install.cmd>${frontend.install.cmd.dev}</frontend.install.cmd>
                <yarn.build>build:dev</yarn.build>
            </properties>
        </profile>
    </profiles>

    <properties>
        <!-- Product versions -->
        <confluence.version>7.0.1-CONFSRVDEV-10457-m03</confluence.version>
        <jira.version>8.3.0-SNAPSHOT</jira.version>

        <!-- Atlassian dependencies -->
        <platform.version>5.0.0</platform.version>
        <amps.version>8.0.0</amps.version>
        <analytics.version>5.7.2</analytics.version>
        <!-- in platform-pom is 4.0.0 -->
        <webresource.version>4.1.2</webresource.version>
        <!-- in platform-pom is 2.1.7 -->
        <atlassian.spring.scanner.version>2.1.8</atlassian.spring.scanner.version>

        <!-- 3rd party dependencies -->
        <rest.assured.version>3.3.0</rest.assured.version>

        <!-- FrontEnd dependencies -->
        <frontend.maven.plugin.version>1.6</frontend.maven.plugin.version>
        <frontend.install.cmd>install --production --frozen-lockfile --prefer-offline --mutex network --no-progress</frontend.install.cmd>
        <frontend.install.cmd.dev>install --frozen-lockfile --prefer-offline --mutex network --no-progress</frontend.install.cmd.dev>
        <yarn.build>build</yarn.build>
        <node.path>${project.build.directory}</node.path>
        <!-- Keep these values in sync with the package.json file -->
        <node.version>v10.15.1</node.version>
        <yarn.version>v1.13.0</yarn.version>

        <!-- This key is used to keep the consistency between the key in atlassian-plugin.xml and the key to generate bundle. -->
        <!-- Keep it in sync with 'pluginKey' in webpack.config.js -->
        <atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <skipTests>false</skipTests>
    </properties>

</project>
