<?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">
    <parent>
        <artifactId>jira-issue-nav-plugin-parent</artifactId>
        <groupId>com.atlassian.jira</groupId>
        <version>23.2.8</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <packaging>atlassian-plugin</packaging>
    <artifactId>jira-issue-nav-components</artifactId>

    <name>Atlassian Jira - Plugins - Components for Issue Navigator</name>
    <description>Provides components for viewing and searching for issues</description>

    <build>
        <plugins>
            <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>
                    <scannedDependencies>
                        <dependency>
                            <groupId>com.atlassian.plugin</groupId>
                            <artifactId>atlassian-spring-scanner-test-example-external-jar</artifactId>
                            <!--
                                        For testing reasons we exclude the transitive dep (atlassian-spring-scanner-test-example-transitive-excluded-jar) but there
                                        is another one (atlassian-spring-scanner-test-example-transitive-jar) in play.

                                        We should see the @Components from atlassian-spring-scanner-test-example-transitive-jar
                                        but not from atlassian-spring-scanner-test-example-transitive-excluded-jar
                               -->
                            <exclusions>
                                <exclusion>
                                    <groupId>com.atlassian.plugin</groupId>
                                    <artifactId>atlassian-spring-scanner-test-example-transitive-excluded-jar</artifactId>
                                </exclusion>
                            </exclusions>
                        </dependency>
                    </scannedDependencies>
                    <verbose>true</verbose>
                    <!-- We are explicitly scanning an external JAR above for this test case, which will
                         never happen in real life but which is apparently needed to test the transitive
                         deps, so we permit duplicate imports here.
                      -->
                    <permitDuplicateImports>true</permitDuplicateImports>
                </configuration>
            </plugin>

            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>jira-maven-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Atlassian-Plugin-Key>com.atlassian.jira.jira-issue-nav-components</Atlassian-Plugin-Key>
                        <Export-Package>
                            com.atlassian.jira.components.*
                        </Export-Package>
                        <Import-Package>
                            com.atlassian.jira.rest.api.v2.*,
                            <!-- To get JSW working (don't ask me how) -->
                            com.atlassian.jira.rest.v2.issue.*,
                            com.atlassian.jira.*;resolution:="optional",
                            org.springframework.*,
<!--                            org.springframework.beans*;version="2.5",-->
<!--                            org.springframework.context*;version="2.5",-->
<!--                            org.springframework.stereotype*;version="2.5",-->
<!--                            org.springframework.util*;version="2.5",-->
                            com.atlassian.sal.api*;resolution:=optional,
                            *;resolution:="optional"
                        </Import-Package>
                        <Spring-Context>*</Spring-Context>
                    </instructions>
                    <pluginArtifacts>
                        <pluginArtifact>
                            <groupId>com.atlassian.jira</groupId>
                            <artifactId>jira-issue-nav-plugin</artifactId>
                            <version>${project.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.jira</groupId>
                            <artifactId>jira-projects-issue-navigator</artifactId>
                            <version>${project.version}</version>
                        </pluginArtifact>
                    </pluginArtifacts>
                    <additionalResourceFolders>${resourcedir.global.issuenav.plugin},${resourcedir.projectcentric.issuenav.plugin}</additionalResourceFolders>
                    <includedFeModuleManifests>
                        <includedFeModuleManifest>${project.basedir}/package.json</includedFeModuleManifest>
                        <includedFeModuleManifest>${project.basedir}/yarn.lock</includedFeModuleManifest>
                    </includedFeModuleManifests>
                    <feManifestAssociations>
                        <feManifestAssociation>
                            <outputDirectoryFilesDeclaration>
                                ${project.basedir}/fe-associations-declaration.json
                            </outputDirectoryFilesDeclaration>
                        </feManifestAssociation>
                    </feManifestAssociations>
                </configuration>
                <executions>
                    <execution>
                        <id>js-enforcement</id>
                        <goals>
                            <goal>verify-fe-manifest-associations</goal>
                        </goals>
                        <phase>verify</phase>
                        <configuration>
                            <verifyFeManifestAssociationsInputEntrypoint>
                                ${project.build.directory}/${project.build.finalName}.jar
                            </verifyFeManifestAssociationsInputEntrypoint>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.9</version>
                <executions>
                    <execution>
                        <id>prepare-agent-unit-test</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report-unit-test</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>prepare-agent-integration-test</id>
                        <goals>
                            <goal>prepare-agent-integration</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report-integration-test</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>report-integration</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.atlassian.drs</groupId>
                <artifactId>dependency-report-maven-plugin</artifactId>
                <configuration>
                    <project>jira-issue-search-plugin</project>
                    <unitTestCodeCoveragePaths>${project.build.directory}/jacoco.exec</unitTestCodeCoveragePaths>
                    <integrationTestCodeCoveragePaths>${project.build.directory}/jacoco-it.exec</integrationTestCodeCoveragePaths>
                    <gracefulFailure>true</gracefulFailure>
                </configuration>
                <executions>
                    <execution>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>upload</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.github.eirslett</groupId>
                <artifactId>frontend-maven-plugin</artifactId>
                <version>${frontend.maven.plugin.version}</version>
                <configuration>
                    <nodeVersion>v${nodeVersion}</nodeVersion>
                    <yarnVersion>v${yarnVersion}</yarnVersion>
                    <installDirectory>${project.build.directory}</installDirectory>
                </configuration>
                <executions>
                    <execution>
                        <id>install-node-and-yarn</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>install-node-and-yarn</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>install-prod-dependencies</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>yarn</goal>
                        </goals>
                        <configuration>
                            <arguments>${frontend.install.cmd}</arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${jdkLevel}</source>
                    <target>${jdkLevel}</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-rest-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-rest-plugin</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.json</groupId>
            <artifactId>atlassian-json-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.analytics</groupId>
            <artifactId>analytics-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins.rest</groupId>
            <artifactId>atlassian-rest-v2-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.inject</groupId>
            <artifactId>jakarta.inject-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.servlet</groupId>
            <artifactId>jakarta.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-tests</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugin</groupId>
            <artifactId>atlassian-spring-scanner-annotation</artifactId>
            <scope>provided</scope>
        </dependency>

    </dependencies>

    <properties>
        <resourcedir.global.issuenav.plugin>${basedir}/../jira-global-issue-navigator-plugin/src/main/resources</resourcedir.global.issuenav.plugin>
        <resourcedir.projectcentric.issuenav.plugin>${basedir}/../jira-projects-issue-navigator-plugin/src/main/resources</resourcedir.projectcentric.issuenav.plugin>
    </properties>

</project>
