<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.atlassian.confluence.plugins</groupId>
        <artifactId>status-macro-project</artifactId>
        <version>20.2.0</version>
    </parent>

    <artifactId>status-macro</artifactId>
    <packaging>atlassian-plugin</packaging>

    <name>Status Macro</name>
    <description>Confluence Status Macro</description>

    <properties>
        <atlassian-plugin-key>${project.groupId}.${project.artifactId}</atlassian-plugin-key>
        <skipJacocoReport>false</skipJacocoReport>
        <sonar.tests />
        <test-coverage.skip-copy-integration-test-report>false</test-coverage.skip-copy-integration-test-report>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.confluence</groupId>
            <artifactId>confluence</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.servlet</groupId>
            <artifactId>jakarta.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugin</groupId>
            <artifactId>atlassian-spring-scanner-annotation</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-text</artifactId>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>com.atlassian.plugin</groupId>
                <artifactId>atlassian-spring-scanner-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>confluence-maven-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <systemPropertyVariables combine.children="append">
                        <confluence.velocity.deprecation.strictmode>false</confluence.velocity.deprecation.strictmode>
                    </systemPropertyVariables>
                    <instructions>
                        <Atlassian-Plugin-Key>${atlassian-plugin-key}</Atlassian-Plugin-Key>
                        <Import-Package>*</Import-Package>
                        <Spring-Context>*</Spring-Context>
                    </instructions>
                    <includedFeModuleManifests>
                        <includedFeModuleManifest>${project.basedir}/package.json</includedFeModuleManifest>
                        <includedFeModuleManifest>${project.basedir}/package-lock.json</includedFeModuleManifest>
                    </includedFeModuleManifests>
                    <feManifestAssociations>
                        <feManifestAssociation>
                            <outputDirectoryFilesDeclaration>${project.basedir}/fe-associations-declaration.json</outputDirectoryFilesDeclaration>
                        </feManifestAssociation>
                    </feManifestAssociations>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>frontend-install</id>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <skip>${npm.install.skip}</skip>
                            <executable>${npm.cmd}</executable>
                            <arguments>
                                <argument>install</argument>
                                <argument>--no-save</argument>
                                <argument>--no-audit</argument>
                                <argument>--prefer-offline</argument>
                            </arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>frontend-build</id>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <skip>false</skip>
                            <executable>${npm.cmd}</executable>
                            <arguments>
                                <argument>run</argument>
                                <argument>${npm.build.script}</argument>
                            </arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>sonar-ut</id>
            <properties>
                <sonar.coverage.jacoco.xmlReportPaths>${project.build.directory}/site/jacoco-unit/${jacoco.report.name}</sonar.coverage.jacoco.xmlReportPaths>
            </properties>
        </profile>
        <profile>
            <id>sonar-it</id>
            <properties>
                <sonar.coverage.jacoco.xmlReportPaths>${project.build.directory}/site/jacoco-integration/${jacoco.report.name}</sonar.coverage.jacoco.xmlReportPaths>
            </properties>
        </profile>
    </profiles>

  <scm>
    <tag>confluence-content-plugins-20.2.0</tag>
  </scm>
</project>
