<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-plugins</artifactId>
    <version>8.5.6</version>
  </parent>
  <artifactId>jira-func-test-plugin</artifactId>
  <name>Atlassian Jira - Plugins - DevMode - Func Test Plugin</name>
  <description>Provides a plugin that allows code to be injected into a functionally tested Jira</description>
  <packaging>bundle</packaging>
  <build>
    <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>
    <plugins>
      <plugin>
          <groupId>com.atlassian.plugin</groupId>
          <artifactId>atlassian-spring-scanner-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <configuration>
          <instructions>
            <Atlassian-Plugin-Key>${atlassian.plugin.key}</Atlassian-Plugin-Key>
            <Bundle-SymbolicName>${atlassian.plugin.key}</Bundle-SymbolicName>
            <Export-Package />
            <Spring-Context>*</Spring-Context>
            <Import-Package>
              !com.sun.tools.javac,
              !org.apache.env.*,
              !org.apache.tools.*,
              !sun.*,
              !org.apache.xmlbeans.*,
              !antlr*,
              com.atlassian.scheduler*,
              com.atlassian.jira.plugin.webfragment.conditions,
              org.apache.commons.io.*;version="2.6",
              *
            </Import-Package>
            <!-- Ideally, we should ensure that the functest-plugin is present, so we can import
                   packages from it, embedding the required dependencies for now -->
            <Embed-Dependency>
              functest-plugin,
              junit,
              hamcrest-core,
              rhino,
              jstyleparser,
              antlr-runtime,
              stringtemplate
            </Embed-Dependency>
            <Include-Resource>
                {maven-resources},
                META-INF/plugin-components=target/classes/META-INF/plugin-components
            </Include-Resource>
          </instructions>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.twdata.maven</groupId>
        <artifactId>maven-cli-plugin</artifactId>
      </plugin>
      <!-- FRONTEND COMPILATION CONFIGURATION
           We're not using the frontend-maven-plugin here, because it doesn't work in conjunction with
           exclusion of JavaScript from the src/main/resources directory via the <resources> block.

           I have no idea how to make this plugin sympathetic to front-end resource compilation.
           The compilation task gets run multiples of times, but none of the assets end up in the JAR.
           I suspect it has something to do with the usage of the maven-bundle-plugin.

           If anybody wants to try and make compiling this plugin via Gulp work, go ahead!
       -->
    </plugins>
  </build>
  <profiles>
      <profile>
          <id>less-css-compile</id>
          <activation>
              <property>
                  <name>!jira.lesscss.compile.skip</name>
              </property>
          </activation>
          <build>
              <plugins>
                  <plugin>
                      <groupId>com.atlassian.lesscss</groupId>
                      <artifactId>lesscss-maven-plugin</artifactId>
                      <executions>
                          <execution>
                              <id>compile-less</id>
                              <phase>process-resources</phase>
                              <goals>
                                  <goal>compile</goal>
                              </goals>
                          </execution>
                      </executions>
                  </plugin>
              </plugins>
          </build>
      </profile>
  </profiles>
  <dependencies>
      <dependency>
          <groupId>com.atlassian.jira</groupId>
          <artifactId>jira-core</artifactId>
          <scope>provided</scope>
      </dependency>
      <dependency>
          <groupId>javax.ws.rs</groupId>
          <artifactId>jsr311-api</artifactId>
          <scope>provided</scope>
      </dependency>
      <dependency>
          <groupId>com.atlassian.jira.tests</groupId>
          <artifactId>jira-testkit-plugin</artifactId>
          <version>${testkit.version}</version>
          <scope>provided</scope>
      </dependency>
      <dependency>
          <groupId>com.atlassian.applinks</groupId>
          <artifactId>applinks-api</artifactId>
          <scope>provided</scope>
      </dependency>
      <dependency>
          <groupId>javax.xml.bind</groupId>
          <artifactId>jaxb-api</artifactId>
          <scope>provided</scope>
      </dependency>
       <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-api</artifactId>
            <scope>provided</scope>
        </dependency>
      <dependency>
          <groupId>com.atlassian.plugins.rest</groupId>
          <artifactId>atlassian-rest-common</artifactId>
          <scope>provided</scope>
      </dependency>
      <dependency>
          <groupId>log4j</groupId>
          <artifactId>log4j</artifactId>
          <scope>provided</scope>
      </dependency>
      <dependency>
          <groupId>javax.servlet</groupId>
          <artifactId>javax.servlet-api</artifactId>
          <scope>provided</scope>
      </dependency>
      <dependency>
          <groupId>com.atlassian.activeobjects</groupId>
          <artifactId>activeobjects-plugin</artifactId>
          <scope>provided</scope>
      </dependency>
      <dependency>
          <groupId>com.atlassian.functest</groupId>
          <artifactId>functest-plugin</artifactId>
          <version>${fp.version}</version>
          <scope>provided</scope>
          <exclusions>
              <exclusion>
                  <groupId>com.google.collections</groupId>
                  <artifactId>google-collections</artifactId>
              </exclusion>
          </exclusions>
      </dependency>
      <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <scope>provided</scope>
      </dependency>
      <dependency>
         <groupId>org.hamcrest</groupId>
         <artifactId>hamcrest-core</artifactId>
         <scope>provided</scope>
      </dependency>
      <dependency>
          <groupId>org.mozilla</groupId>
          <artifactId>rhino</artifactId>
          <version>1.7.7</version>
      </dependency>
      <dependency>
          <groupId>net.sf.cssbox</groupId>
          <artifactId>jstyleparser</artifactId>
          <version>1.16-atlassian-1</version>
      </dependency>
      <dependency>
          <groupId>org.antlr</groupId>
          <artifactId>antlr-runtime</artifactId>
          <version>3.5.2</version>
      </dependency>
      <dependency>
          <groupId>org.mockito</groupId>
          <artifactId>mockito-core</artifactId>
          <scope>test</scope>
      </dependency>

      <!-- transformless plugins dependencies -->
      <dependency>
          <groupId>com.atlassian.plugin</groupId>
          <artifactId>atlassian-spring-scanner-annotation</artifactId>
          <scope>provided</scope>
      </dependency>

      <dependency>
          <groupId>org.hamcrest</groupId>
          <artifactId>hamcrest-library</artifactId>
          <scope>test</scope>
      </dependency>
      <dependency>
          <groupId>org.antlr</groupId>
          <artifactId>stringtemplate</artifactId>
          <scope>provided</scope>
      </dependency>
  </dependencies>
  <properties>
    <atlassian.plugin.key>com.atlassian.jira.dev.func-test-plugin</atlassian.plugin.key>
  </properties>
</project>
