<?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">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.atlassian.refapp</groupId>
        <artifactId>atlassian-refapp-plugin-parent</artifactId>
        <version>7.0.15</version>
    </parent>

    <artifactId>atlassian-refapp-sal-plugin</artifactId>
    <packaging>atlassian-plugin</packaging>

    <name>Reference App SAL Plugin</name>
    <description>Plugin that implements SAL with Trusted Applications support for the reference app</description>

    <properties>
        <atlassian.plugin.key>com.atlassian.refapp.sal</atlassian.plugin.key>
        <sonar.coverage.jacoco.xmlReportPaths>${project.basedir}/../${jacoco.report.file}</sonar.coverage.jacoco.xmlReportPaths>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-osgi-javaconfig</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.refapp</groupId>
            <artifactId>refapp-api</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-core</artifactId>
            <!--
            Ideally sal-core would be provided by the core product,
            but it requires other libraries that currently are provided by a plugin (atlassian-seraph),
            so it cannot be moved easily.
            All dependencies of sal-core should be provided by the product.
            By excluding all transitive dependencies,
            we are ensuring there won't be any accidental library added to this plugin in the future (if sal-core dependencies will change).
            If sal-core start require some library that is not provided by the core product,
            it will be discovered by the integration tests.
            -->
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-spi</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.refapp</groupId>
            <artifactId>atlassian-refapp-auth-plugin</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.refapp</groupId>
            <artifactId>atlassian-refapp-core</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-osgi</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.beehive</groupId>
            <artifactId>beehive-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.velocity</groupId>
            <artifactId>velocity</artifactId>
            <scope>provided</scope>
        </dependency>
        <!-- should be provided by the app or another plugin -->
        <dependency>
            <groupId>com.atlassian.seraph</groupId>
            <artifactId>atlassian-seraph</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.extras</groupId>
            <artifactId>atlassian-extras</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.oauth</groupId>
            <artifactId>atlassian-oauth-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.profiling</groupId>
            <artifactId>atlassian-profiling</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.servlet</groupId>
            <artifactId>jakarta.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>io.atlassian.fugue</groupId>
            <artifactId>fugue</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.inject</groupId>
            <artifactId>jakarta.inject-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.ws.rs</groupId>
            <artifactId>jakarta.ws.rs-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins.rest</groupId>
            <artifactId>atlassian-rest-v2-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- Test Dependencies -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-library</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>amps-maven-plugin</artifactId>
                <configuration>
                    <instructions>
                        <Atlassian-Plugin-Key>com.atlassian.refapp.sal</Atlassian-Plugin-Key>
                        <Bundle-SymbolicName>com.atlassian.refapp.sal</Bundle-SymbolicName>
                        <Bundle-Name>com.atlassian.refapp.sal</Bundle-Name>
                        <Spring-Context>*</Spring-Context>
                        <Import-Package>
                            *
                        </Import-Package>
                    </instructions>
                    <banningExcludes>
                        <exclude>com.atlassian.sal:sal-core</exclude>
                    </banningExcludes>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
