<?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.platform.pom</groupId>
        <artifactId>platform-defaults-public</artifactId>
        <version>9.0.0-m015</version>
    </parent>

    <groupId>com.atlassian.plugins</groupId>
    <artifactId>jquery</artifactId>
    <version>4.0.0.6</version>


    <name>jquery</name>
    <description>Atlassian plugin wrapper containing only jQuery.</description>
    <packaging>atlassian-plugin</packaging>

    <build>
        <plugins>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>amps-maven-plugin</artifactId>
                <version>${amps.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <!-- JS are minified by FrontEnd tools (take a look at frontend-maven-plugin and package.json) -->
                    <compressJs>false</compressJs>
                    <enableQuickReload>true</enableQuickReload>
                    <instructions>
                        <Atlassian-Plugin-Key>${atlassian.plugin.key}</Atlassian-Plugin-Key>
                        <!-- SAL Condition is used in plugin descriptor - we want to fail plugin startup fast to detect
                                any issues so the web-resources are in an expected state -->
                        <Import-Package>
                            com.atlassian.sal.api.features,
                            *;resolution:=optional
                        </Import-Package>
                        <Spring-Context>*</Spring-Context>
                    </instructions>
                    <includedFeModuleManifests>
                        <includedFeModuleManifest>${project.basedir}/package.json</includedFeModuleManifest>
                        <includedFeModuleManifest>${project.basedir}/yarn.lock</includedFeModuleManifest>
                    </includedFeModuleManifests>
                    <feManifestAssociations>
                        <feManifestAssociation>
                            <packageName>@atlassian/atlassian-plugins-jquery</packageName>
                            <manuallyVerifiedEveryFileHasItsDependenciesDeclaredInTheManifest>
                                <outputDirectoryFiles>
                                    jquery.min.js,
                                    jquery.js,
                                </outputDirectoryFiles>
                            </manuallyVerifiedEveryFileHasItsDependenciesDeclaredInTheManifest>
                        </feManifestAssociation>
                    </feManifestAssociations>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <tagNameFormat>release/@{project.version}</tagNameFormat>
                </configuration>
            </plugin>
            <plugin>
                <!-- Install front-end modules and run ESLint -->
                <groupId>com.github.eirslett</groupId>
                <artifactId>frontend-maven-plugin</artifactId>
                <version>${frontend.maven.plugin.version}</version>
                <configuration>
                    <installDirectory>${frontend.maven.plugin.install.directory}</installDirectory>
                </configuration>
                <executions>
                    <execution>
                        <id>install-node-and-corepack</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>install-node-and-corepack</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>install-dependencies</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>corepack</goal>
                        </goals>
                        <configuration>
                            <arguments>yarn install --immutable</arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>build-js</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>corepack</goal>
                        </goals>
                        <configuration>
                            <arguments>yarn run build</arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>run tests</id>
                        <phase>test</phase>
                        <goals>
                            <goal>corepack</goal>
                        </goals>
                        <configuration>
                            <arguments>yarn test</arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <properties>
        <atl.osgi-javaconfig.version>0.6.0</atl.osgi-javaconfig.version>

        <atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>


        <amps.version>9.12.6</amps.version>
        <frontend.maven.plugin.version>1.15.1-atlassian-6</frontend.maven.plugin.version>
    </properties>

    <scm>
        <connection>scm:git:git@bitbucket.org:atlassian/dc-platform.git</connection>
        <developerConnection>scm:git:git@bitbucket.org:atlassian/dc-platform.git</developerConnection>
        <url>https://bitbucket.org/atlassian/dc-platform</url>
        <tag>release/4.0.0.6</tag>
    </scm>

    <issueManagement>
        <system>Jira</system>
        <url>https://ecosystem.atlassian.net/browse/JQUERY</url>
    </issueManagement>
</project>
