<?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>confluence-frontend-plugins</artifactId>
        <version>20.2.6</version>
    </parent>

    <artifactId>sticky-table-headers</artifactId>
    <packaging>atlassian-plugin</packaging>

    <name>Sticky Table Headers</name>
    <description>Plugin to add support for stalking table headers in confluence.</description>

    <properties>
        <maven.test.skip>${skipTests}</maven.test.skip>
        <npm.build.script>build</npm.build.script>
        <npm.build.skip>false</npm.build.skip>
        <npm.install.skip>false</npm.install.skip>
        <npm.test.skip>${maven.test.skip}</npm.test.skip>
        <sonar.javascript.lcov.reportPaths>target/coverage/lcov/lcov.info</sonar.javascript.lcov.reportPaths>
        <sonar.sources>src/main/frontend</sonar.sources>
    </properties>

    <build>
        <plugins>
            <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>${npm.build.skip}</skip>
                            <executable>${npm.cmd}</executable>
                            <arguments>
                                <argument>run</argument>
                                <argument>${npm.build.script}</argument>
                            </arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>frontend-checks</id>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <phase>test</phase>
                        <configuration>
                            <skip>${npm.test.skip}</skip>
                            <workingDirectory>${project.basedir}</workingDirectory>
                            <executable>${npm.cmd}</executable>
                            <arguments>
                                <argument>run</argument>
                                <argument>checks</argument>
                            </arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>confluence-maven-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Atlassian-Plugin-Key>${project.groupId}.${project.artifactId}</Atlassian-Plugin-Key>
                        <Atlassian-Scan-Folders>META-INF/plugin-descriptors</Atlassian-Scan-Folders>
                        <Spring-Context>*</Spring-Context>
                    </instructions>
                    <productVersion>${confluence.version}</productVersion>
                    <productDataVersion>${confluence.data.version}</productDataVersion>
                    <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>com.atlassian.maven.plugins</groupId>
                <artifactId>amps-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>
