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

    <groupId>com.atlassian.plugins</groupId>
    <artifactId>react</artifactId>
    <version>2.0.0</version>

    <name>Atlassian React Plugin</name>
    <description>Atlassian plugin providing React and its various dependencies for global shared use in Atlassian DC Apps</description>
    <packaging>atlassian-plugin</packaging>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.atlassian.platform.dependencies</groupId>
                <artifactId>platform-public-api</artifactId>
                <version>9.0.0-m021</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>com.atlassian.plugins</groupId>
                <artifactId>atlassian-dark-features-rest-plugin</artifactId>
                <version>${atl.darkfeatures.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.plugins</groupId>
                <artifactId>atlassian-dark-features-ui-plugin</artifactId>
                <version>${atl.darkfeatures.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.plugins</groupId>
                <artifactId>atlassian-dark-features-test-utils</artifactId>
                <version>${atl.darkfeatures.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-osgi-javaconfig</artifactId>
            <version>0.7.0</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-core</artifactId>
            <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-webresource-api</artifactId>
            <scope>provided</scope>
        </dependency>

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

        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-dark-features-test-utils</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>rest-assured</artifactId>
            <version>${rest-assured.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest</artifactId>
            <version>${hamcrest.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>amps-maven-plugin</artifactId>
                <version>${amps.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <!-- we're copying over the originally minified JS files -->
                    <compressJs>false</compressJs>
                    <enableQuickReload>true</enableQuickReload>
                    <extractDependencies>false</extractDependencies>
                    <products>
                        <product>
                            <id>refapp</id>
                            <version>${platform.version}</version>
                        </product>
                    </products>
                    <instructions>
                        <Atlassian-Plugin-Key>${atlassian.plugin.key}</Atlassian-Plugin-Key>
                        <Atlassian-Scan-Folders>META-INF/plugin-descriptors</Atlassian-Scan-Folders>
                        <Import-Package>
                            <!-- Required for web-resource condition: DarkFeatureEnabledCondition -->
                            com.atlassian.sal.api.features,

                            *,
                        </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-react</packageName>
                            <manuallyVerifiedEveryFileHasItsDependenciesDeclaredInTheManifest>
                                <outputDirectoryFiles>
                                    modules/react-dom-development.amd.js,
                                    modules/react-dom-production.amd.js,
                                    modules/react-dom-client-development.amd.js,
                                    modules/react-dom-client-production.amd.js,
                                    modules/react-dom-server-development.amd.js,
                                    modules/react-dom-server-production.amd.js,
                                    modules/react-jsx-runtime-development.amd.js,
                                    modules/react-jsx-runtime-production.amd.js,
                                    modules/react-library-development.amd.js,
                                    modules/react-library-production.amd.js,
                                </outputDirectoryFiles>
                            </manuallyVerifiedEveryFileHasItsDependenciesDeclaredInTheManifest>
                        </feManifestAssociation>
                    </feManifestAssociations>
                    <pluginArtifacts>
                        <pluginArtifact>
                            <groupId>com.atlassian.plugins</groupId>
                            <artifactId>atlassian-dark-features-ui-plugin</artifactId>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.plugins</groupId>
                            <artifactId>atlassian-dark-features-rest-plugin</artifactId>
                        </pluginArtifact>
                    </pluginArtifacts>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.diffplug.spotless</groupId>
                <artifactId>spotless-maven-plugin</artifactId>
                <version>${spotless.version}</version>
                <configuration>
                    <java>
                        <palantirJavaFormat>
                            <version>2.72.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>
            <plugin>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <tagNameFormat>atlassian-plugins-react-@{project.version}</tagNameFormat>
                </configuration>
            </plugin>
            <plugin>
                <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>prepare-js-tests</id>
                        <phase>test</phase>
                        <goals>
                            <goal>corepack</goal>
                        </goals>
                        <configuration>
                            <arguments>yarn run test:prepare</arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>run-js-tests</id>
                        <phase>test</phase>
                        <goals>
                            <goal>corepack</goal>
                        </goals>
                        <configuration>
                            <arguments>yarn run test</arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <properties>
        <failOnMilestoneOrReleaseCandidateDeps>false</failOnMilestoneOrReleaseCandidateDeps>
        <maven.compiler.release>25</maven.compiler.release>
        <atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>

        <platform.version>9.0.0-m024</platform.version>
        <amps.version>9.13.0</amps.version>
        <frontend.maven.plugin.version>1.15.4-atlassian-1</frontend.maven.plugin.version>
        <junit.version>4.13.2</junit.version>
        <atl.darkfeatures.version>2.2.1</atl.darkfeatures.version>
        <testrunner.version>2.0.13</testrunner.version>
        <rest-assured.version>6.0.1</rest-assured.version>
        <hamcrest.version>3.0</hamcrest.version>
        <spotless.version>3.9.0</spotless.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>atlassian-plugins-react-2.0.0</tag>
    </scm>

    <licenses>
        <license>
            <name>BSD License</name>
            <url>https://opensource.org/licenses/BSD-3-Clause</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
</project>