<?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>

  <name>Atlassian Stash Remote Events Bitbucket SPI</name>
  <description>Transforms Bitbucket events to remote events so external applications can be notified</description>

  <parent>
    <groupId>com.atlassian.stash.plugins</groupId>
    <artifactId>stash-remote-event-parent</artifactId>
    <version>0.7.0</version>
  </parent>

  <artifactId>stash-remote-event-bitbucket-server-spi</artifactId>
  <packaging>atlassian-plugin</packaging>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.atlassian.bitbucket.server</groupId>
        <artifactId>bitbucket-parent</artifactId>
        <version>${bitbucket.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>com.atlassian.stash.plugins</groupId>
      <artifactId>stash-remote-event-api</artifactId>
    </dependency>

    <dependency>
      <groupId>org.eclipse.gemini.blueprint</groupId>
      <artifactId>gemini-blueprint-core</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.atlassian.plugins</groupId>
      <artifactId>atlassian-remote-event-api</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <!-- Needed just for the BundleContext hack - see *EventProducer.destroy() -->
    <dependency>
      <groupId>org.apache.felix</groupId>
      <artifactId>org.apache.felix.framework</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.atlassian.bitbucket.server</groupId>
      <artifactId>bitbucket-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.atlassian.plugins.rest</groupId>
      <artifactId>atlassian-rest-module</artifactId>
      <scope>provided</scope>
    </dependency>

    <!-- transformerless plugin deps -->
    <dependency>
      <groupId>javax.inject</groupId>
      <artifactId>javax.inject</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.atlassian.plugin</groupId>
      <artifactId>atlassian-spring-scanner-annotation</artifactId>
    </dependency>
    <dependency>
      <groupId>com.atlassian.plugin</groupId>
      <artifactId>atlassian-spring-scanner-processor</artifactId>
    </dependency>
    <dependency>
      <groupId>com.atlassian.plugin</groupId>
      <artifactId>atlassian-spring-scanner-runtime</artifactId>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <scope>provided</scope>
    </dependency>

    <!-- Test dependencies -->
    <dependency>
      <groupId>com.atlassian.bitbucket.server</groupId>
      <artifactId>bitbucket-it-common</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>com.jayway.restassured</groupId>
      <artifactId>rest-assured</artifactId>
      <scope>test</scope>
    </dependency>

    <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.apache.httpcomponents</groupId>
      <artifactId>httpcore</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpclient</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>com.atlassian.maven.plugins</groupId>
        <artifactId>maven-amps-plugin</artifactId>
        <extensions>true</extensions>

        <configuration>
          <extractDependencies>true</extractDependencies>
          <instructions>
            <Atlassian-Plugin-Key>${project.groupId}.${project.artifactId}</Atlassian-Plugin-Key>
            <Bundle-Name>Bitbucket Server - Remote Events SPI</Bundle-Name>
            <Spring-Context>*</Spring-Context>
          </instructions>

          <systemPropertyVariables>
            <!-- Bitbucket func tests don't know how to wait for the system to be available, so force
                     it to come up synchronously so that Cargo will block for us -->
            <johnson.spring.lifecycle.synchronousStartup>true</johnson.spring.lifecycle.synchronousStartup>
          </systemPropertyVariables>

          <products>
            <!-- Bitbucket Server -->
            <product>
              <id>bitbucket</id>
              <instanceId>bitbucket</instanceId>
              <version>${bitbucket.version}</version>
              <httpPort>${bitbucket.port}</httpPort>
              <output>${project.build.directory}/bitbucket.log</output>
              <installPlugin>true</installPlugin>
              <containerId>tomcat8x</containerId>
            </product>
          </products>

          <testGroups>
            <testGroup>
              <id>stash-integration-tests</id>
              <productIds>
                <productId>bitbucket</productId>
              </productIds>
              <includes>
                <include>it/com/atlassian/bitbucket/plugin/remote/event/rest/resource/*Test.java</include>
              </includes>
            </testGroup>
          </testGroups>

        </configuration>
        </plugin>
    </plugins>
  </build>
    
</project>