<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">
  <parent>
    <groupId>com.atlassian.bamboo</groupId>
    <artifactId>atlassian-bamboo-components</artifactId>
    <version>4.4</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.atlassian.bamboo</groupId>
  <artifactId>atlassian-bamboo-web-app</artifactId>
  <version>4.4</version>

  <packaging>war</packaging>

  <name>Atlassian Bamboo Web Application</name>

  <dependencies>
    <dependency>
      <groupId>com.atlassian.sal</groupId>
      <artifactId>sal-api</artifactId>
    </dependency>

    <dependency>
      <groupId>com.atlassian.applinks</groupId>
      <artifactId>applinks-api</artifactId>
    </dependency>

    <dependency>
      <groupId>com.atlassian.applinks</groupId>
      <artifactId>applinks-host</artifactId>
    </dependency>

    <dependency>
      <groupId>com.atlassian.applinks</groupId>
      <artifactId>applinks-spi</artifactId>
    </dependency>

    <!-- Module dependencies -->
    <dependency>
      <groupId>com.atlassian.bamboo</groupId>
      <artifactId>atlassian-bamboo-web</artifactId>
    </dependency>

    <dependency>
      <groupId>com.atlassian.bamboo</groupId>
      <artifactId>atlassian-bamboo-test-utils</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>com.atlassian.bamboo</groupId>
      <artifactId>atlassian-bamboo-plugins1-plugins</artifactId>
      <type>pom</type>
      <version>4.4</version>
    </dependency>

    <dependency>
      <groupId>com.atlassian.bamboo</groupId>
      <artifactId>atlassian-bamboo-agent-elastic-s3-bucket</artifactId>
      <type>aws</type>
    </dependency>

    <!-- Ensure that bundled modules aren't added twice but is still built before -->
    <dependency>
      <groupId>com.atlassian.bamboo</groupId>
      <artifactId>atlassian-bamboo-bundled-plugins</artifactId>
      <type>zip</type>
      <scope>provided</scope>
    </dependency>

    <!-- Ensure that atlassian-bamboo-agent-installer isn't added twice but is still built before -->
    <dependency>
      <groupId>com.atlassian.bamboo</groupId>
      <artifactId>atlassian-bamboo-agent-installer</artifactId>
      <scope>provided</scope>
    </dependency>

    <!-- Ensure that bamboo-agent isn't added twice but is still built before -->
    <dependency>
      <groupId>com.atlassian.bamboo</groupId>
      <artifactId>bamboo-agent</artifactId>
      <scope>provided</scope>
    </dependency>

    <!-- Hack for some weird mvn bug -->
    <dependency>
      <groupId>cglib</groupId>
      <artifactId>cglib-nodep</artifactId>
    </dependency>

    <!--another hack for weird mvn bug - testtools with test scope excludes this-->
    <dependency>
      <groupId>dom4j</groupId>
      <artifactId>dom4j</artifactId>
    </dependency>

    <!--another hack for weird mvn bug: client depends on core, client is included, core is not-->
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpcore</artifactId>
    </dependency>

    <dependency>
      <groupId>commons-collections</groupId>
      <artifactId>commons-collections</artifactId>
    </dependency>

    <dependency>
      <groupId>com.atlassian.security.auth.trustedapps</groupId>
      <artifactId>atlassian-trusted-apps-core</artifactId>
    </dependency>

    <!--Currently required on the class path, by crowd + other plugins that use REST-->
    <dependency>
      <groupId>com.sun.xml.bind</groupId>
      <artifactId>jaxb-impl</artifactId>
    </dependency>

    <!-- PostgreSQL JDBC driver -->
    <dependency>
      <groupId>postgresql</groupId>
      <artifactId>postgresql</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- MS SQL JDBC Driver -->
    <dependency>
      <groupId>net.sourceforge.jtds</groupId>
      <artifactId>jtds</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- Oracle JDBC Driver -->
    <dependency>
      <groupId>com.oracle</groupId>
      <artifactId>oracle-jdbc15</artifactId>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <configuration>
          <archive>
            <manifest>
              <addClasspath>true</addClasspath>
            </manifest>
          </archive>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <!-- makes it a little easier to isolate the cause of the spring hibernate tests when they fail -->
          <forkMode>always</forkMode>
        </configuration>
      </plugin>

      <!-- Plugin for packaging the agent jars-->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <phase>process-resources</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>com.atlassian.bamboo</groupId>
                  <artifactId>atlassian-bamboo-agent-installer</artifactId>
                  <outputDirectory>${project.build.directory}/${project.artifactId}/admin/agent</outputDirectory>
                </artifactItem>
                <artifactItem>
                  <groupId>com.atlassian.bamboo</groupId>
                  <artifactId>bamboo-agent</artifactId>
                  <outputDirectory>${project.build.directory}/${project.artifactId}/admin/agent</outputDirectory>
                </artifactItem>
                <artifactItem>
                  <groupId>com.atlassian.bamboo</groupId>
                  <artifactId>atlassian-bamboo-bundled-plugins</artifactId>
                  <type>zip</type>
                  <outputDirectory>${project.build.directory}/classes</outputDirectory>
                  <destFileName>atlassian-bundled-plugins.zip</destFileName>
                </artifactItem>
                <artifactItem>
                  <groupId>com.atlassian.bamboo</groupId>
                  <artifactId>atlassian-bamboo-agent-installer</artifactId>
                  <type>jar</type>
                  <outputDirectory>${project.build.directory}/classes</outputDirectory>
                  <destFileName>agent-installer.jar</destFileName>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- Plugins for bundled Atlassian plugins 2.0 -->
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>2.0.0</version>
      </plugin>

      <plugin>
        <groupId>com.atlassian.maven.plugins</groupId>
        <artifactId>maven-aws-plugin</artifactId>
        <executions>
          <execution>
            <phase>process-resources</phase>
            <goals>
              <goal>awsinclude</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.lesscss</groupId>
        <artifactId>lesscss-maven-plugin</artifactId>
        <version>1.3.0</version>
        <configuration>
          <sourceDirectory>${project.basedir}/src/main/webapp</sourceDirectory>
          <outputDirectory>${project.basedir}/src/main/webapp</outputDirectory>
          <compress>true</compress>
          <includes>
            <include>layout/setup/setup.less</include>
          </includes>
        </configuration>
        <executions>
          <execution>
            <phase>process-resources</phase>
            <goals>
              <goal>compile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>enforce-banned-dependencies</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <bannedDependencies>
                  <searchTransitive>false</searchTransitive>
                  <excludes>
                    <exclude>javax.servlet</exclude>
                    <exclude>javax.servlet.jsp</exclude>
                  </excludes>
                  <includes>
                    <include>javax.servlet:*:*:provided</include>
                    <include>javax.servlet.jsp:*:*:provided</include>
                  </includes>
                  <message>See Servlet Spec 2.3, section 9.7.2.</message>
                </bannedDependencies>
              </rules>
              <fail>true</fail>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <properties>
    <pluginBundleDirectory>target/bundled-plugins</pluginBundleDirectory>
  </properties>
</project>
