<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.jira</groupId>
        <artifactId>jira-rest</artifactId>
        <version>10.3.0</version>
    </parent>
    <artifactId>jira-rest-plugin</artifactId>
    <name>Atlassian Jira - Plugins - REST Plugin</name>
    <description>Provides a REST interface for Jira</description>
    <packaging>bundle</packaging>
    <properties>
        <atlassian.plugin.key>com.atlassian.jira.rest</atlassian.plugin.key>
        <send.mail.disabled>true</send.mail.disabled>
        <atlassian.dev.mode>true</atlassian.dev.mode>
        <javadoc.failonerror>true</javadoc.failonerror>
    </properties>
    <build>
        <plugins>
            <plugin>
                <groupId>org.twdata.maven</groupId>
                <artifactId>maven-cli-plugin</artifactId>
              </plugin>
              <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                  <executions>
                    <execution>
                      <id>create-bundle</id>
                      <phase>package</phase>
                      <goals>
                        <goal>bundle</goal>
                      </goals>
                    </execution>
                  </executions>
                  <configuration>
                    <instructions>
                      <Atlassian-Plugin-Key>${atlassian.plugin.key}</Atlassian-Plugin-Key>
                      <Spring-Context>*</Spring-Context>
                      <Require-Bundle>
                          com.atlassian.sal.jira
                      </Require-Bundle>
                      <Import-Package>
                          com.atlassian.annotations,
                          com.atlassian.core.*,
                          com.atlassian.crowd.*,
                          com.atlassian.event.api,
                          com.atlassian.fugue,
                          com.atlassian.gadgets.*,
                          com.atlassian.jira.*,
                          com.atlassian.johnson,
                          com.atlassian.mail,
                          com.atlassian.mail.server,
                          com.atlassian.plugin,
                          com.atlassian.plugins.rest.api.*,
                          com.atlassian.query,
                          com.atlassian.sal.api.websudo,
                          com.atlassian.seraph.*,
                          io.atlassian.util.concurrent,
                          com.atlassian.validation,
                          com.google.common.*,
                          com.opensymphony.module.propertyset.*,
                          com.opensymphony.util,
                          com.opensymphony.workflow.loader,
                          javax.annotation,
                          javax.inject*,
                          javax.servlet,
                          javax.servlet.http,
                          javax.ws.rs.*,
                          javax.xml.bind.*,
                          org.aopalliance.aop,
                          org.apache.commons.io.*;version="2",
                          org.apache.commons.*,
                          org.apache.log4j;version="1.2",
                          org.ofbiz.core.*,
                          org.osgi.framework,
                          org.slf4j,
                          org.springframework.aop,
                          org.springframework.aop.framework,
                          org.springframework.aop.scope,
                          org.springframework.beans.factory.*,
                          org.springframework.core,
                          org.w3c.dom,
                          webwork.config,
                          com.atlassian.plugin.osgi.factory,
                          com.atlassian.analytics.api.annotations;resolution:="optional",
                          *;resolution:=optional
                      </Import-Package>
                      <Export-Package>
                         com.atlassian.jira.rest.api.*;version="${project.version}",
                         com.atlassian.jira.rest.v1.*;version="${project.version}",
                         com.atlassian.jira.rest.v2.*;version="${project.version}",
                         com.atlassian.jira.rest.util;version="${project.version}",
                         com.atlassian.jira.dashboard
                      </Export-Package>
                      <Embed-Dependency>*;scope=compile;inline=false</Embed-Dependency>
                    </instructions>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.7</version>
                <executions>
                    <execution>
                        <id>add-plugin-components</id>
                        <phase>package</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <tasks>
                                <zip destfile="${project.build.directory}/${project.artifactId}-${project.version}.jar" update="true" basedir="${project.build.outputDirectory}" includes="META-INF/plugin-components/**" />
                            </tasks>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.atlassian.plugin</groupId>
                <artifactId>atlassian-spring-scanner-maven-plugin</artifactId>
            </plugin>
        </plugins>
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
                <filtering>true</filtering>
                <includes>
                    <include>localtest.properties</include>
                </includes>
            </testResource>
            <testResource>
                <directory>src/test/xml</directory>
                <targetPath>xml</targetPath>
                <filtering>false</filtering>
                <includes>
                    <include>*.xml</include>
                </includes>
            </testResource>
        </testResources>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
                <includes>
                    <include>atlassian-plugin.xml</include>
                </includes>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>false</filtering>
                <excludes>
                    <exclude>atlassian-plugin.xml</exclude>
                </excludes>
            </resource>
        </resources>
    </build>

    <profiles>
        <profile>
            <id>jvm17</id>
            <activation>
                <jdk>17</jdk>
            </activation>
            <properties>
                <!-- TODO Remove it after migrating com.sun.javadoc to jdk.javadoc -->
                <javadoc.failonerror>false</javadoc.failonerror>
            </properties>
        </profile>
    </profiles>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-core</artifactId>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.security</groupId>
                    <artifactId>spring-security-core</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.atlassian.p4package</groupId>
                    <artifactId>atlassian-p4package</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.atlassian.modzdetector</groupId>
                    <artifactId>modz-detector</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.atlassian.crowd</groupId>
            <artifactId>embedded-crowd-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.crowd</groupId>
            <artifactId>embedded-crowd-core</artifactId>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>javax.ws.rs</groupId>
                    <artifactId>jsr311-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.sun.jersey</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-rest-api</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins.rest</groupId>
            <artifactId>atlassian-rest-v2-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins.rest</groupId>
            <artifactId>atlassian-rest-v2-internal-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.xml.bind</groupId>
            <artifactId>jakarta.xml.bind-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.servlet</groupId>
            <artifactId>jakarta.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aop</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-1.2-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.plugins.rest</groupId>
            <artifactId>atlassian-rest-v2-plugin</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-tests</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>com.atlassian.modzdetector</groupId>
                    <artifactId>modz-detector</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.atlassian.labs.mockito</groupId>
            <artifactId>mockito-booster</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.core</groupId>
            <artifactId>atlassian-core-logging</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.core</groupId>
            <artifactId>atlassian-core-user</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.core</groupId>
            <artifactId>atlassian-core-thumbnail</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.classloader</groupId>
            <artifactId>atlassian-classloader</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira.plugins</groupId>
            <artifactId>jira-core-project-templates-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira.plugins</groupId>
            <artifactId>project-templates-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugin</groupId>
            <artifactId>atlassian-spring-scanner-annotation</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.inject</groupId>
            <artifactId>jakarta.inject-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.reflections</groupId>
            <artifactId>reflections</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>net.sf.supercsv</groupId>
            <artifactId>super-csv</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>${assertj.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.core</groupId>
            <artifactId>jersey-common</artifactId>
            <version>${jersey.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>
