<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>2.5.5</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    
    <groupId>com.atlassian.bamboo</groupId>
    <artifactId>atlassian-bamboo-web-app</artifactId>
    <version>2.5.5</version>
    
    <packaging>war</packaging>
    
    <name>Atlassian Bamboo Web Application</name>
    
    <dependencies>
        
        <!-- Module dependencies -->
        <dependency>
            <groupId>com.atlassian.bamboo</groupId>
            <artifactId>atlassian-bamboo-web</artifactId>
        </dependency>
        
        <!-- Bamboo SHIPPED PLUGINS - ensure parent pom.xml is also updated.-->
        <dependency>
            <groupId>com.atlassian.bamboo.plugins</groupId>
            <artifactId>atlassian-bamboo-plugin-autofavourite</artifactId>
        </dependency>
        
        <dependency>
            <groupId>com.atlassian.bamboo.plugins</groupId>
            <artifactId>atlassian-bamboo-plugin-clover</artifactId>
        </dependency>
        
        <dependency>
            <groupId>com.atlassian.bamboo.plugins.builder</groupId>
            <artifactId>atlassian-bamboo-plugin-phpbuilder</artifactId>
        </dependency>
        
        <dependency>
            <groupId>com.atlassian.bamboo.plugins.repository</groupId>
            <artifactId>atlassian-bamboo-plugin-vcsversion</artifactId>
        </dependency>
        
        <dependency>
            <groupId>com.atlassian.bamboo.plugins.labeller</groupId>
            <artifactId>atlassian-bamboo-plugin-labeller</artifactId>
        </dependency>
        
        <dependency>
            <groupId>com.atlassian.bamboo.plugins.buildnumberstamper</groupId>
            <artifactId>atlassian-bamboo-plugin-buildnumberstamper</artifactId>
        </dependency>
        
        <dependency>
            <groupId>com.atlassian.bamboo.plugins</groupId>
            <artifactId>atlassian-bamboo-plugin-maven2</artifactId>
        </dependency>

      <dependency>
        <groupId>com.atlassian.bamboo.plugins.fisheyecommitviewer</groupId>
        <artifactId>atlassian-bamboo-plugin-fisheyecommitviewer</artifactId>
      </dependency>

        <dependency>
            <groupId>com.atlassian.bamboo.plugins.nant</groupId>
            <artifactId>nant_builder</artifactId>
        </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>pom</type>
            <scope>provided</scope>
        </dependency>
        
        <dependency>
            <groupId>commons-fileupload</groupId>
            <artifactId>commons-fileupload</artifactId>
        </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>
        
        
        <dependency>
            <groupId>commons-collections</groupId>
            <artifactId>commons-collections</artifactId>
        </dependency>
        
    </dependencies>
    
    <build>
        <plugins>
            
            <!-- Plugin for packaging the agent jars-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>compile</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>
                            </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>
            
            <!-- Bundling plugins-->
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-bundled-plugins</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${pluginBundleDirectory}</outputDirectory>
                            <artifactItems>
                                
                                <!-- ========================================================================================== REST -->
                                <!-- REST Plugin module type -->
                                <artifactItem>
                                    <groupId>com.atlassian.plugins.rest</groupId>
                                    <artifactId>atlassian-rest-module</artifactId>
                                </artifactItem>
                                
                                <!-- Bundle required by REST -->
                                <artifactItem>
                                    <groupId>biz.aQute</groupId>
                                    <artifactId>bndlib</artifactId>
                                    <version>0.0.255</version>
                                </artifactItem>
                                
                                <artifactItem>
                                    <groupId>com.atlassian.templaterenderer</groupId>
                                    <artifactId>atlassian-template-renderer-api</artifactId>
                                    <version>${atlassian.renderer.version}</version>
                                </artifactItem>
                                
                                <artifactItem>
                                    <groupId>com.atlassian.templaterenderer</groupId>
                                    <artifactId>atlassian-template-renderer-velocity1.6-plugin</artifactId>
                                    <version>${atlassian.renderer.version}</version>
                                </artifactItem>
                                
                                <!--<artifactItem>-->
                                <!--<groupId>com.atlassian.plugin.rest</groupId>-->
                                <!--<artifactId>atlassian-rest-plugin-manager-plugin</artifactId>-->
                                <!--<version>0.4</version>-->
                                <!--</artifactItem>-->
                                
                                <!-- =========================================================================================== SAL -->
                                <!-- SAL APIs -->
                                <artifactItem>
                                    <groupId>com.atlassian.sal</groupId>
                                    <artifactId>sal-api</artifactId>
                                    <version>${salVersion}</version>
                                </artifactItem>
                                
                                <!-- Bamboo's SAL implementation -->
                                <artifactItem>
                                    <groupId>com.atlassian.bamboo.plugins</groupId>
                                    <artifactId>atlassian-bamboo-plugin-sal</artifactId>
                                </artifactItem>
                              <!-- =========================================================================================== OAUTH -->
                              <artifactItem>
                                <groupId>com.atlassian.oauth</groupId>
                                <artifactId>atlassian-oauth-api</artifactId>
                                <version>${oauthVersion}</version>
                              </artifactItem>

                              <artifactItem>
                                <groupId>com.atlassian.oauth</groupId>
                                <artifactId>atlassian-oauth-service-provider-plugin</artifactId>
                                <version>${oauthVersion}</version>
                              </artifactItem>

                              <artifactItem>
                                <groupId>com.atlassian.oauth</groupId>
                                <artifactId>atlassian-oauth-admin-plugin</artifactId>
                                <version>${oauthVersion}</version>
                              </artifactItem>
                           
                              <artifactItem>
                                <groupId>org.apache.httpcomponents</groupId>
                                <artifactId>httpcore-osgi</artifactId>
                                <version>4.0</version>
                              </artifactItem>

                              <artifactItem>
                                <groupId>org.apache.httpcomponents</groupId>
                                <artifactId>httpclient-osgi</artifactId>
                                <version>4.0-beta2</version>
                              </artifactItem>

                              <artifactItem>
                                <groupId>com.atlassian.oauth</groupId>
                                <artifactId>atlassian-oauth-service-provider-spi</artifactId>
                                <version>${oauthVersion}</version>
                              </artifactItem>

                              <artifactItem>
                                <groupId>com.atlassian.oauth</groupId>
                                <artifactId>atlassian-oauth-service-provider-sal-plugin</artifactId>
                                <version>${oauthVersion}</version>
                              </artifactItem>

                              <artifactItem>
                                <groupId>com.atlassian.oauth</groupId>
                                <artifactId>atlassian-oauth-consumer-spi</artifactId>
                                <version>${oauthVersion}</version>
                              </artifactItem>

                              <!-- ======================================================================================= Gadgets -->
                              <!-- Atlassian Gadgets API JAR -->
                              <artifactItem>
                                <groupId>com.atlassian.gadgets</groupId>
                                <artifactId>atlassian-gadgets-api</artifactId>
                                <version>${atlassian.gadgets.version}</version>
                              </artifactItem>

                              <!--Atlassian Gadgets SPI -->
                              <artifactItem>
                                <groupId>com.atlassian.gadgets</groupId>
                                <artifactId>atlassian-gadgets-spi</artifactId>
                                <version>${atlassian.gadgets.version}</version>
                              </artifactItem>

                              <!--Atlassian Gadgets Renderer -->
                              <!--<artifactItem>-->
                              <!--<groupId>com.atlassian.gadgets</groupId>-->
                              <!--<artifactId>atlassian-gadgets-renderer-plugin</artifactId>-->
                              <!--<version>${atlassian.gadgets.version}</version>-->
                              <!--</artifactItem>-->

                              <!--Gadget Spec Publisher -->
                              <artifactItem>
                                <groupId>com.atlassian.gadgets</groupId>
                                <artifactId>atlassian-gadgets-publisher-plugin</artifactId>
                                <version>${atlassian.gadgets.version}</version>
                              </artifactItem>

                              <!--Required for @NotNull annotations -->
                              <artifactItem>
                                <groupId>com.atlassian.gadgets</groupId>
                                <artifactId>jsr305</artifactId>
                                <version>1.0.0.m5</version>
                              </artifactItem>

                              <!-- =========================================================================== REST Bundled plugin -->
                              <artifactItem>
                                <groupId>com.atlassian.bamboo.plugins</groupId>
                                <artifactId>atlassian-bamboo-plugin-rest</artifactId>
                              </artifactItem>

                              <!-- =========================================================================== Bundled gadgets plugin -->

                              <artifactItem>
                                <groupId>com.atlassian.bamboo.gadgets</groupId>
                                <artifactId>atlassian-bamboo-gadgets</artifactId>
                              </artifactItem>
                              <!-- =========================================================================== AUI -->
                              <artifactItem>
                                <groupId>com.atlassian.aui</groupId>
                                <artifactId>auiplugin</artifactId>
                              </artifactItem>

                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            
            <!-- Creating the zip-->
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.2-beta-1</version>
                <configuration>
                    <finalName>atlassian</finalName>
                    <descriptors>
                        <descriptor>src/main/assembly/bundled-plugins.xml</descriptor>
                    </descriptors>
                    <outputDirectory>${project.build.outputDirectory}</outputDirectory>
                </configuration>
                <executions>
                    <execution>
                        <id>create-bundled-plugins</id>
                        <!--
                so that it happens just after the unit tests ran successfuly
                it should be changes to pre-package when maven 2.1 is out
            -->
                        <phase>process-resources</phase>
                        <goals>
                            <goal>attached</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    
    <properties>
        <pluginBundleDirectory>target/bundled-plugins</pluginBundleDirectory>
    </properties>
</project>
