<?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>public-pom</artifactId>
        <version>6.3.1</version>
    </parent>

    <groupId>com.atlassian.plugins</groupId>
    <artifactId>jquery</artifactId>
    <version>3.6.0.5</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}/package-lock.json</includedFeModuleManifest>
                    </includedFeModuleManifests>
                    <feManifestAssociations>
                        <feManifestAssociation>
                            <packageName>atlassian-plugins-jquery</packageName>
                            <manuallyVerifiedEveryFileHasItsDependenciesDeclaredInTheManifest>
                                <outputDirectoryFiles>
                                    jquery-migrate-logging-min.js,
                                    jquery-migrate-logging.js,
                                    jquery-migrate-min.js,
                                    jquery-migrate.js,
                                    jquery-min.js,
                                    jquery.js,
                                    plugins/jquery.browser-min.js,
                                    plugins/jquery.browser.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>
                    <nodeVersion>${nodeVersion}</nodeVersion>
                    <installDirectory>${frontend.maven.plugin.install.directory}</installDirectory>
                </configuration>
                <executions>
                    <execution>
                        <id>install-node-and-npm</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>install-node-and-npm</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>install-dependencies</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                        <configuration>
                            <arguments>install --prefer-offline --no-audit --no-save --no-optional</arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>build-js</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                        <configuration>
                            <arguments>run build</arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>minify-js</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                        <configuration>
                            <arguments>run minify</arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>run tests</id>
                        <phase>test</phase>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                        <configuration>
                            <arguments>test</arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

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

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

        <amps.version>8.15.2</amps.version>
        <frontend.maven.plugin.version>1.15.0</frontend.maven.plugin.version>

        <!-- keep in sync with the .nvmrc file -->
        <nodeVersion>v16.20.2</nodeVersion>
    </properties>

    <scm>
        <connection>scm:git:ssh://git@bitbucket.org/atlassian/atlassian-plugins-jquery.git</connection>
        <developerConnection>scm:git:ssh://git@bitbucket.org/atlassian/atlassian-plugins-jquery.git</developerConnection>
        <url>https://bitbucket.org/atlassian/atlassian-plugins-jquery</url>
        <tag>release/3.6.0.5</tag>
    </scm>

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