<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.bamboo</groupId>
    <artifactId>atlassian-bamboo-plugins2-parent</artifactId>
    <version>5.8.0</version>
  </parent>

  <groupId>com.atlassian.bamboo.plugins.stash</groupId>
  <artifactId>atlassian-bamboo-plugin-stash</artifactId>
  <packaging>atlassian-plugin</packaging>

  <name>Atlassian Bamboo Stash Repository Plugin</name>
  <description>Stash Web Repository Viewer plugin for Bamboo</description>

  <properties>
    <bamboo.port>6990</bamboo.port>
    <stash.port>7990</stash.port>
    <stash-java-client.version>1.3.9</stash-java-client.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>com.atlassian.bamboo</groupId>
      <artifactId>atlassian-bamboo-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.atlassian.bamboo</groupId>
      <artifactId>atlassian-bamboo-core</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.atlassian.bamboo</groupId>
      <artifactId>atlassian-bamboo-web</artifactId>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <groupId>bouncycastle</groupId>
          <artifactId>bcprov-jdk14</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.bouncycastle</groupId>
          <artifactId>bcprov-jdk15</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.bouncycastle</groupId>
          <artifactId>bcmail-jdk15</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.bouncycastle</groupId>
          <artifactId>bcprov-jdk16</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.atlassian.plugins.rest</groupId>
      <artifactId>atlassian-rest-common</artifactId>
      <scope>provided</scope>
      <exclusions>
        <!-- this conflicts with org.ow2.asm:asm:jar:4.1 required by rest-assured in scope test -->
        <exclusion>
          <groupId>asm</groupId>
          <artifactId>asm</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.atlassian.bamboo.plugins</groupId>
      <artifactId>atlassian-bamboo-plugin-git</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.atlassian.stash</groupId>
      <artifactId>stash-java-client-applinks</artifactId>
      <version>${stash-java-client.version}</version>
    </dependency>
    <dependency>
      <groupId>com.atlassian.stash</groupId>
      <artifactId>stash-java-client-api</artifactId>
      <version>${stash-java-client.version}</version>
    </dependency>
    <dependency>
      <groupId>com.atlassian.plugins</groupId>
      <artifactId>atlassian-remote-event-common-plugin</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.atlassian.stash.plugins</groupId>
      <artifactId>stash-remote-event-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <!--<dependency>-->
      <!--<groupId>com.atlassian.stash.plugins</groupId>-->
      <!--<artifactId>stash-remote-event-bamboo-spi</artifactId>-->
      <!--<scope>provided</scope>-->
    <!--</dependency>-->
    <dependency>
      <groupId>com.atlassian.applinks</groupId>
      <artifactId>applinks-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.google.code.gson</groupId>
      <artifactId>gson</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.atlassian.plugins</groupId>
      <artifactId>atlassian-nav-links-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.atlassian.bamboo.triggers</groupId>
      <artifactId>atlassian-bamboo-triggers</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.atlassian.event</groupId>
      <artifactId>atlassian-event</artifactId>
    </dependency>
    <dependency>
      <groupId>com.atlassian.plugins</groupId>
      <artifactId>atlassian-plugins-core</artifactId>
    </dependency>

    <!-- Test dependencies -->
    <dependency>
      <groupId>com.atlassian.bamboo</groupId>
      <artifactId>atlassian-bamboo-test-utils</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.atlassian.bamboo.plugins</groupId>
      <artifactId>atlassian-bamboo-plugin-test-utils</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.atlassian.bamboo</groupId>
      <artifactId>atlassian-bamboo-pageobjects</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.atlassian.stash</groupId>
      <artifactId>stash-page-objects</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.jayway.restassured</groupId>
      <artifactId>rest-assured</artifactId>
      <scope>test</scope>
    </dependency>
    <!-- required for webdriver tests -->
    <dependency>
      <groupId>com.atlassian.browsers</groupId>
      <artifactId>atlassian-browsers-auto</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <scope>provided</scope>
    </dependency>

  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <parallel>methods</parallel>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.atlassian.maven.plugins</groupId>
        <artifactId>maven-amps-plugin</artifactId>
        <extensions>true</extensions>
        <configuration>
          <products>
            <!-- Bamboo -->
            <product>
              <id>bamboo</id>
              <instanceId>bamboo</instanceId>
              <version>${atlassian.product.version}</version>
              <httpPort>${bamboo.port}</httpPort>
              <output>${project.build.directory}/bamboo.log</output>
              <productDataPath>${basedir}/src/test/resources/bamboo-test-resources.zip</productDataPath>
              <containerId>${amps.containerId}</containerId>
              <ajpPort>8009</ajpPort>
              <pluginArtifacts>
                <pluginArtifact>
                  <groupId>com.atlassian.bamboo.plugins</groupId>
                  <artifactId>atlassian-bamboo-plugin-test-utils</artifactId>
                </pluginArtifact>
              </pluginArtifacts>
              <systemPropertyVariables>
                <atlassian.profile.activate>true</atlassian.profile.activate>
              </systemPropertyVariables>
            </product>
            <!-- Stash -->
            <product>
              <id>stash</id>
              <instanceId>stash</instanceId>
              <version>${stash.version}</version>
              <httpPort>${stash.port}</httpPort>
              <output>${project.build.directory}/stash.log</output>
              <installPlugin>false</installPlugin>
              <productDataPath>${basedir}/src/test/resources/stash-test-resources.zip</productDataPath>
              <containerId>tomcat7x</containerId>
              <ajpPort>8010</ajpPort>
              <bundledArtifacts>
                <bundledArtifact>
                  <groupId>com.atlassian.stash.plugins</groupId>
                  <artifactId>stash-remote-event-stash-spi</artifactId>
                  <version>${bamboo.stash.remote.event.version}</version>
                </bundledArtifact>
              </bundledArtifacts>
            </product>
          </products>

          <systemPropertyVariables>
            <webdriver.firefox.logfile>${project.build.directory}/webdriverTmp/firefox.log</webdriver.firefox.logfile>
          </systemPropertyVariables>

          <testGroups>
            <testGroup>
              <id>stash-integration-tests</id>
              <productIds>
                <productId>bamboo</productId>
                <productId>stash</productId>
              </productIds>
              <includes>
                <include>it/com/atlassian/bamboo/plugins/stash/StashIntegrationTestHarness.java</include>
              </includes>
            </testGroup>
          </testGroups>

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