
<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.confluence</groupId>
        <artifactId>confluence-project</artifactId>
        <version>3.0.1</version>
    </parent>

    <artifactId>confluence-webapp</artifactId>
    <packaging>war</packaging>

    <name>Confluence Webapp</name>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.confluence</groupId>
            <artifactId>confluence</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.confluence</groupId>
            <artifactId>confluence-compatibility</artifactId>
            <version>${project.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.confluence.cache</groupId>
            <artifactId>confluence-cache-ehcache</artifactId>
            <version>${project.version}</version>
            <scope>runtime</scope>                   
        </dependency>

        <!-- bundled JDBC drivers -->
        <dependency>
            <groupId>net.sourceforge.jtds</groupId>
            <artifactId>jtds</artifactId>
            <version>1.2.2</version>
            <scope>runtime</scope>
        </dependency>

        <!-- Remote API Plugin -->
        <dependency>
            <groupId>com.atlassian.confluence.plugins</groupId>
            <artifactId>confluence-rpc-plugin</artifactId>
            <version>${project.version}</version>
            <scope>runtime</scope>
        </dependency>
        <!-- TinyMCE editor -->
        <dependency>
            <groupId>com.atlassian.confluence.tinymceplugin</groupId>
            <artifactId>confluence-tinymce-plugin</artifactId>
            <version>${project.version}</version>
            <scope>runtime</scope>
        </dependency>
        <!-- language packs -->
        <dependency>
            <groupId>com.atlassian.confluence.plugins</groupId>
            <artifactId>confluence-de_DE-plugin</artifactId>
            <version>1.9</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.confluence.plugins</groupId>
            <artifactId>confluence-fr_FR-plugin</artifactId>
            <version>1.15</version>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>
        <dependency>
            <groupId>mockobjects</groupId>
            <artifactId>mockobjects-core</artifactId>
        </dependency>
        <dependency>
            <groupId>mockobjects</groupId>
            <artifactId>mockobjects</artifactId>
        </dependency>

        <dependency>
            <groupId>com.atlassian.confluence</groupId>
            <artifactId>confluence-acceptance-test</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>

        <!-- test dependencies required by Jetty test harness -->
        <dependency>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>jetty</artifactId>
            <version>6.1.5</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>jetty-management</artifactId>
            <version>6.1.5</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>tomcat</groupId>
            <artifactId>jasper-runtime</artifactId>
            <version>5.0.28</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>commons-el</groupId>
            <artifactId>commons-el</artifactId>
            <version>1.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.confluence.plugins</groupId>
            <artifactId>confluence-functestrpc-plugin</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.confluence.plugins</groupId>
            <artifactId>confluence-functestxss-plugin</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-ctk-plugin</artifactId>
            <version>${sal.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <finalName>confluence</finalName>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <excludes>
                    <exclude>confluence-init.properties</exclude>
                </excludes>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <configuration>
                            <tasks>
                                <delete dir="${pluginBundleDirectory}" />
                            </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>download-bundled-plugins</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${pluginBundleDirectory}</outputDirectory>
                            <artifactItems>
                                <!--
                                     Bundled plugins
                                 -->
                                <!-- Advanced Macros -->
                                <artifactItem>
                                    <groupId>com.atlassian.confluence.plugins</groupId>
                                    <artifactId>confluence-advanced-macros</artifactId>
                                    <version>1.6.2.8</version>
                                </artifactItem>
                                <!-- Attachment Extractors -->
                                <artifactItem>
                                    <groupId>com.atlassian.confluence.plugins</groupId>
                                    <artifactId>confluence-attachment-extractors</artifactId>
                                    <version>1.0</version>
                                </artifactItem>
                                <!-- Attachments Plugin -->
                                <artifactItem>
                                    <groupId>com.atlassian.confluence.plugins</groupId>
                                    <artifactId>confluence-attachments-plugin</artifactId>
                                    <version>2.15</version>
                                </artifactItem>
                                <!-- Basic Macros -->
                                <artifactItem>
                                    <groupId>com.atlassian.confluence.plugins</groupId>
                                    <artifactId>confluence-basic-macros</artifactId>
                                    <version>1.4</version>
                                </artifactItem>
                                <!-- Blogging RPC -->
                                <artifactItem>
                                    <groupId>com.atlassian.confluence.plugins.xmlrpc.bloggingrpc</groupId>
                                    <artifactId>bloggingrpc</artifactId>
                                    <version>1.2.4</version>
                                </artifactItem>
                                <!-- Charts -->
                                <artifactItem>
                                    <groupId>com.atlassian.confluence.extra.chart</groupId>
                                    <artifactId>chart-plugin</artifactId>
                                    <version>1.12</version>
                                </artifactItem>
                                <!-- Code Macro -->
                                <artifactItem>
                                    <groupId>com.atlassian.confluence.plugins</groupId>
                                    <artifactId>confluence-code-macro</artifactId>
                                    <version>1.5</version>
                                </artifactItem>
                                <!-- Compatibility Macros -->
                                <artifactItem>
                                    <groupId>com.atlassian.confluence.plugins</groupId>
                                    <artifactId>confluence-compatibility-macros</artifactId>
                                    <version>1.5</version>
                                </artifactItem>
                                <!-- Contributors -->
                                <artifactItem>
                                    <groupId>com.atlassian.confluence.contributors</groupId>
                                    <artifactId>contributors</artifactId>
                                    <version>1.2.3</version>
                                </artifactItem>
                                <!-- Dashboard Macros -->
                                <artifactItem>
                                    <groupId>com.atlassian.confluence.plugins</groupId>
                                    <artifactId>confluence-dashboard-macros</artifactId>
                                    <version>1.12</version>
                                </artifactItem>
                                <!-- Dynamic Task List 2 -->
                                <artifactItem>
                                    <groupId>com.atlassian.confluence.extra</groupId>
                                    <artifactId>dynamictasklist2</artifactId>
                                    <version>3.2.4</version>
                                </artifactItem>
                                <!-- HTML Macros -->
                                <artifactItem>
                                    <groupId>com.atlassian.confluence.plugins</groupId>
                                    <artifactId>confluence-html-macros</artifactId>
                                    <version>1.7.2</version>
                                </artifactItem>
                                <!-- Information Plugin -->
                                <artifactItem>
                                    <groupId>com.atlassian.confluence.plugins</groupId>
                                    <artifactId>confluence-information-plugin</artifactId>
                                    <version>1.1</version>
                                </artifactItem>
                                <!-- IM Presence 2 -->
                                <artifactItem>
                                    <groupId>com.atlassian.confluence.extra.impresence2</groupId>
                                    <artifactId>impresence-plugin</artifactId>
                                    <version>2.5</version>
                                </artifactItem>
                                <!-- JIRA 3 Plugin -->
                                <artifactItem>
                                    <groupId>com.atlassian.confluence.plugins</groupId>
                                    <artifactId>confluence-jira3-plugin</artifactId>
                                    <version>2.8.13</version>
                                </artifactItem>
                                <!-- Layout Plugin -->
                                <artifactItem>
                                    <groupId>com.atlassian.confluence.plugins</groupId>
                                    <artifactId>confluence-layout-plugin</artifactId>
                                    <version>1.3</version>
                                </artifactItem>
                                <!-- Live Search Plugin -->
                                <artifactItem>
                                    <groupId>com.atlassian.confluence.plugins</groupId>
                                    <artifactId>confluence-livesearch-plugin</artifactId>
                                    <version>2.10</version>
                                </artifactItem>
                                <!-- Mail Page -->
                                <artifactItem>
                                    <groupId>com.atlassian.confluence.extra.email</groupId>
                                    <artifactId>confluence.extra.email</artifactId>
                                    <version>1.7</version>
                                </artifactItem>
                                <!-- Master-Detail Plugin -->
                                <artifactItem>
                                    <groupId>com.atlassian.confluence.plugins</groupId>
                                    <artifactId>confluence-masterdetail-plugin</artifactId>
                                    <version>2.7</version>
                                </artifactItem>
                                <!-- Atlassian Plugin Repository -->
                                <artifactItem>
                                    <groupId>com.atlassian.ext</groupId>
                                    <artifactId>atlassian-plugin-repository-confluence-plugin</artifactId>
                                    <version>2.1.4</version>
                                </artifactItem>
                                <!-- Social bookmarking -->
                                <artifactItem>
                                    <groupId>com.atlassian.confluence.plugins.socialbookmarking</groupId>
                                    <artifactId>socialbookmarking</artifactId>
                                    <version>1.3.1</version>
                                </artifactItem>
                                <!-- Table of Contents -->
                                <artifactItem>
                                    <groupId>net.customware.confluence.plugin.toc</groupId>
                                    <artifactId>toc-plugin</artifactId>
                                    <version>2.4.10.1</version>
                                </artifactItem>
                                <!-- Usage tracking -->
                                <artifactItem>
                                    <groupId>com.atlassian.confluence.extra.usage</groupId>
                                    <artifactId>usage-tracking-plugin</artifactId>
                                    <version>0.11</version>
                                </artifactItem>
                                <!-- User Lister Plugin -->
                                <artifactItem>
                                    <groupId>com.atlassian.confluence.plugins</groupId>
                                    <artifactId>confluence-userlister-plugin</artifactId>
                                    <version>2.4.2</version>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>com.atlassian.confluence.plugins.uwc</groupId>
                                    <artifactId>uwcimporter-adminpanel</artifactId>
                                    <version>1.1</version>
                                </artifactItem>
                                <!-- WebDAV -->
                                <artifactItem>
                                    <groupId>com.atlassian.confluence.extra.webdav</groupId>
                                    <artifactId>webdav-plugin</artifactId>
                                    <version>2.3</version>
                                </artifactItem>
                                <!-- Confluence Page Tree Plugin-->
                                <artifactItem>
                                    <groupId>com.atlassian.confluence.plugins</groupId>
                                    <artifactId>pagetree</artifactId>
                                    <version>1.11</version>
                                </artifactItem>
                                <!-- Thread dump plugin -->
                                <artifactItem>
                                    <groupId>com.atlassian.confluence.plugin.threaddump</groupId>
                                    <artifactId>confluence-threaddump-plugin</artifactId>
                                    <version>1.2</version>
                                </artifactItem>
                                <!-- Clickr theme -->
                                <artifactItem>
                                    <groupId>com.atlassian.confluence.themes.clickr</groupId>
                                    <artifactId>clickr-theme-plugin</artifactId>
                                    <version>2.5</version>
                                </artifactItem>
                                <!-- Left navigation theme -->
                                <artifactItem>
                                    <groupId>com.atlassian.confluence.themes.leftnavigation</groupId>
                                    <artifactId>confluence-leftnavigation-theme</artifactId>
                                    <version>2.7</version>
                                </artifactItem>
                                <!-- Office Connector -->
                                <artifactItem>
                                    <groupId>com.atlassian.confluence.officeconnector</groupId>
                                    <artifactId>OfficeConnector</artifactId>
                                    <version>1.5</version>
                                </artifactItem>
                                <!-- Widget Connector -->
                                <artifactItem>
                                    <groupId>com.atlassian.confluence.extra.widgetconnector</groupId>
                                    <artifactId>widgetconnector</artifactId>
                                    <version>1.2.3</version>
                                </artifactItem>
                                <!-- AUI Plugin -->
                                 <artifactItem>
                                    <groupId>com.atlassian.aui</groupId>
                                    <artifactId>auiplugin</artifactId>
                                    <version>1.0.2</version>
                                </artifactItem>
                                <!-- New PDF Export -->
                                <artifactItem>
                                    <groupId>com.atlassian.confluence.extra</groupId>
                                    <artifactId>confluence-flyingpdf-plugin</artifactId>
                                    <version>1.1</version>
                                </artifactItem>
                                
                                <!-- SAL plugin api and implementation -->
								<artifactItem>
								    <groupId>com.atlassian.sal</groupId>
								    <artifactId>sal-api</artifactId>
								    <version>${sal.version}</version>
								</artifactItem>
								<artifactItem>
								    <groupId>com.atlassian.sal</groupId>
								    <artifactId>sal-confluence-plugin</artifactId>
								    <version>${sal.version}</version>
								</artifactItem>
                                
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <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>src/main/resources/com/atlassian/confluence/setup</outputDirectory>
                </configuration>
                <executions>
                    <execution>
                        <id>create-bundled-plugins</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>attached</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- creating the resin3 specific web.xml -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>xml-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>web.resin3.xml</id>
                        <configuration>
                            <transformationSets>
                                <transformationSet>
                                    <dir>src/main/webapp/WEB-INF/</dir>
                                    <includes>
                                        <include>web.xml</include>
                                    </includes>
                                    <stylesheet>src/main/xml/resin3patch.xslt</stylesheet>
                                    <outputDir>${project.build.directory}/${project.build.finalName}/WEB-INF</outputDir>
                                    <fileMappers>
                                        <fileMapper implementation="org.codehaus.plexus.components.io.filemappers.MergeFileMapper">
                                            <targetName>web.resin3.xml</targetName>
                                        </fileMapper>
                                    </fileMappers>
                                </transformationSet>
                            </transformationSets>
                        </configuration>
                        <goals>
                            <goal>transform</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>web.servlet2-4.xml</id>
                        <configuration>
                            <transformationSets>
                                <transformationSet>
                                    <dir>src/main/webapp/WEB-INF/</dir>
                                    <includes>
                                        <include>web.xml</include>
                                    </includes>
                                    <stylesheet>src/main/xml/servlet2-4patch.xslt</stylesheet>
                                    <outputDir>${project.build.directory}/${project.build.finalName}/WEB-INF</outputDir>
                                    <fileMappers>
                                        <fileMapper implementation="org.codehaus.plexus.components.io.filemappers.MergeFileMapper">
                                            <targetName>web.servlet2-4.xml</targetName>
                                        </fileMapper>
                                    </fileMappers>
                                </transformationSet>
                            </transformationSets>
                        </configuration>
                        <goals>
                            <goal>transform</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>net.sf.saxon</groupId>
                        <artifactId>saxon</artifactId>
                        <version>8.7</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>

    <profiles>

        <!-- WARNING: This profile must be first otherwise the tests get screwed up -->
        <profile>
            <id>run-acceptance-test</id>
            <activation>
                <property>
                    <name>!maven.test.skip</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-clean-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>clean_confluence_home</id>
                                <phase>pre-integration-test</phase>
                                <goals>
                                    <goal>clean</goal>
                                </goals>
                                <configuration>
                                    <excludeDefaultDirectories>true</excludeDefaultDirectories>
                                    <filesets>
                                        <fileset>
                                            <directory>${project.build.directory}/confluence-home</directory>
                                            <includes>
                                                <include>**/*</include>
                                            </includes>
                                        </fileset>
                                    </filesets>
                                    <skip>${keep.confluence.home}</skip>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <executions>
                            <execution>
                                <!--
                        Use the dependency plugin to extract the Confluence acceptance tests into the test output directory
                        -->
                                <id>unpack-confluence-tests</id>
                                <phase>pre-integration-test</phase>
                                <goals>
                                    <goal>unpack-dependencies</goal>
                                </goals>
                                <configuration>
                                    <excludeTransitive>true</excludeTransitive>
                                    <includeArtifactIds>confluence-acceptance-test</includeArtifactIds>
                                    <outputDirectory>${project.build.directory}/it-classes</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <!--
                        Use the dependency plugin to copy the Confluence dynamic plugins to be installed during testing.
                        -->
                                <id>copy-dynamic-plugins</id>
                                <phase>pre-integration-test</phase>
                                <goals>
                                    <goal>copy-dependencies</goal>
                                </goals>
                                <configuration>
                                    <excludeTransitive>true</excludeTransitive>
                                    <includeArtifactIds>confluence-functestrpc-plugin,confluence-functestxss-plugin,sal-ctk-plugin</includeArtifactIds>
                                    <stripVersion>true</stripVersion>
                                </configuration>
                            </execution>

                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.cargo</groupId>
                        <artifactId>cargo-maven2-plugin</artifactId>
                        <version>0.3.1</version>
                        <configuration>
                            <wait>${cargo.wait}</wait>
                            <container>
                                <containerId>tomcat5x</containerId>
                                <zipUrlInstaller>
                                    <url>https://m2proxy.atlassian.com/repository/internal/org/apache/tomcat/apache-tomcat/5.5.25/apache-tomcat-5.5.25.zip</url>
                                    <installDir>target/installs</installDir>
                                </zipUrlInstaller>
                                <output>${project.build.directory}/output.log</output>
                                <log>${project.build.directory}/cargo-log.log</log>
                                <systemProperties>
                                    <confluence.home>${project.build.directory}/confluence-home</confluence.home>
                                    <clover.distributed.coverage>${clover.distributed.coverage}</clover.distributed.coverage>
                                </systemProperties>
                            </container>
                            <configuration>
                                <home>${project.build.directory}/tomcat5x/container</home>
                                <properties>
                                    <cargo.servlet.port>${http.port}</cargo.servlet.port>
                                    <cargo.rmi.port>${cargo.rmi.port}</cargo.rmi.port>
                                    <cargo.jvmargs>${jvm.args}</cargo.jvmargs>
                                </properties>
                                <deployables>
                                    <deployable>
                                        <groupId>com.atlassian.confluence</groupId>
                                        <artifactId>confluence-webapp</artifactId>
                                        <type>war</type>
                                        <properties>
                                            <context>confluence</context>
                                        </properties>
                                        <pingURL>${confluence.url}</pingURL>
                                        <pingTimeout>60000</pingTimeout>
                                    </deployable>
                                </deployables>
                            </configuration>
                        </configuration>
                        <executions>
                            <execution>
                                <id>start-container</id>
                                <phase>pre-integration-test</phase>
                                <goals>
                                    <goal>start</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin><!-- This must be run before clover2:optimize. -->
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <skip>${maven.test.it.skip}</skip>
                            <systemProperties>
                                <property>
                                    <name>http.port</name>
                                    <value>${http.port}</value>
                                </property>
                                <property>
                                    <name>smtp.port</name>
                                    <value>${smtp.port}</value>
                                </property>
                                <property>
                                    <name>webappContext</name>
                                    <value>${confluence.context}</value>
                                </property>
                                <property>
                                    <name>confluence.version</name>
                                    <value>${project.version}</value>
                                </property>
                                <property>
                                    <name>baseurl</name>
                                    <value>${confluence.url}</value>
                                </property>
                                <property>
                                    <name>confluence.log.file.handlers</name>
                                    <value>${confluence.log.file.handlers}</value>
                                </property>
                                <property>
                                    <name>dynamicPluginDirectory</name>
                                    <value>${project.build.directory}/dependency</value>
                                </property>
                                <property>
                                    <name>sal.version</name>
                                    <value>${sal.version}</value>
                                </property>
                                <property> <!-- These can't be defined only in the 50_acceptance_test execution since config doesn't get merged.-->
                                    <name>clover.distributed.coverage</name>
                                    <value>${clover.distributed.coverage}</value>
                                </property>
                                <property>
                                    <name>clover.server</name>
                                    <value>${clover.server}</value>
                                </property>
                            </systemProperties>
                        </configuration>
                        <executions>
                            <execution>
                                <id>00_setup</id>
                                <phase>pre-integration-test</phase> <!-- Needed so that clover can optimize acceptance tests.-->
                                <goals>
                                    <goal>test</goal>
                                </goals>
                                <configuration>
                                    <skip>${maven.test.it.skip}</skip>
                                    <testClassesDirectory>${project.build.directory}/it-classes</testClassesDirectory>
                                    <includes>
                                        <include>com/atlassian/confluence/SetupAcceptanceTest.java</include>
                                    </includes>
                                </configuration>
                            </execution>
                            <execution>
                                <id>50_acceptance_tests</id>
                                <phase>integration-test</phase>
                                <goals>
                                    <goal>test</goal>
                                </goals>
                                <configuration>
                                    <skip>${maven.test.it.skip}</skip>
                                    <testClassesDirectory>${project.build.directory}/it-classes</testClassesDirectory>
                                    <includes>
                                        <include>com/atlassian/confluence/*AcceptanceTest.java</include>
                                    </includes>
                                    <excludes>
                                        <exclude>com/atlassian/confluence/SetupAcceptanceTest.java</exclude>
                                        <exclude>**/Abstract*.java</exclude>
                                        <exclude>com/atlassian/confluence/rpc/RpcLoadTest.java</exclude>
                                        <exclude>com/atlassian/confluence/AcceptanceTest*.java</exclude>
                                        <exclude>com/atlassian/confluence/KnownBugsAcceptanceTest.java</exclude>
                                    </excludes>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>clover-optimize</id>
            <dependencies>
                <dependency> 
                    <groupId>com.cenqua.clover</groupId>
                    <artifactId>clover</artifactId>
                    <version>${clover.version}</version>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <version>1.2</version>
                        <executions>
                            <execution>
                                <id>add-test-source</id>
                                <phase>process-test-classes</phase>
                                <goals>
                                    <goal>add-test-source</goal>
                                </goals>
                                <configuration>
                                    <sources>
                                        <source>../conf-acceptance-test/src/main/java/</source>
                                    </sources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>com.atlassian.maven.plugins</groupId>
                        <artifactId>maven-clover2-plugin</artifactId>
                        <version>${clover.version}</version>
                        <configuration>
                            <singleCloverDatabase>true</singleCloverDatabase>
                            <forceSnapshot>true</forceSnapshot>
                            <optimizeIncludes>
                                <optimizeInclude>com/atlassian/confluence/*AcceptanceTest.java</optimizeInclude>
                            </optimizeIncludes>
                            <optimizeExcludes>
                                <optimizeExclude>com/atlassian/confluence/SetupAcceptanceTest.java</optimizeExclude>
                                <optimizeExclude>**/Abstract*.java</optimizeExclude>
                                <optimizeExclude>com/atlassian/confluence/rpc/RpcLoadTest.java</optimizeExclude>
                                <optimizeExclude>com/atlassian/confluence/AcceptanceTest*.java</optimizeExclude>
                                <optimizeExclude>com/atlassian/confluence/KnownBugsAcceptanceTest.java</optimizeExclude>
                                <!-- TODO: Clover causes this test to FAIL due to duplicates on the classpath. -->
                                <optimizeExclude>com/atlassian/confluence/ClasspathAcceptanceTest.java</optimizeExclude>
                            </optimizeExcludes>

                        </configuration>

                        <executions>
                            <execution>
                                <id>10_setup</id>
                                <phase>pre-integration-test</phase>
                                <goals>
                                    <goal>optimize</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>snapshot</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>snapshot</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                </plugins>
            </build>
            <properties>
                <clover.distributed.coverage>port=${clover.port};numClients=1;timeout=${clover.timeout}</clover.distributed.coverage>
                <clover.server>true</clover.server>
                <http.port>47372</http.port>
                <cargo.rmi.port>47373</cargo.rmi.port>
                <smtp.port>47374</smtp.port>
                <jvm.args>-XX:MaxPermSize=256M  -Djava.awt.headless=true -Xmx512m</jvm.args>
            </properties>
        </profile>


        <profile>
            <id>netstat</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <version>1.0.2</version>
                        <executions>
                            <execution>
                                <id>00_exec_netstat_pre</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <configuration>
                                    <executable>/bin/netstat</executable>
                                    <arguments>
                                        <argument>-nap</argument>
                                    </arguments>
                                </configuration>
                            </execution>

                            <execution>
                                <id>01_exec_ps_pre</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <configuration>
                                    <executable>/bin/ps</executable>
                                    <arguments>
                                        <argument>auxwww</argument>
                                    </arguments>
                                </configuration>
                            </execution>

                            <execution>
                                <id>00_exec_netstat_post</id>
                                <phase>post-integration-test</phase>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <configuration>
                                    <executable>/bin/netstat</executable>
                                    <arguments>
                                        <argument>-nap</argument>
                                    </arguments>
                                </configuration>
                            </execution>

                            <execution>
                                <id>01_exec_ps_post</id>
                                <phase>post-integration-test</phase>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <configuration>
                                    <executable>/bin/ps</executable>
                                    <arguments>
                                        <argument>auxwww</argument>
                                    </arguments>
                                </configuration>
                            </execution>

                        </executions>
                    </plugin>

                </plugins>
            </build>
        </profile>
        <profile>
            <id>full</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>50_acceptance_tests</id>
                                <phase>integration-test</phase>
                                <goals>
                                    <goal>test</goal>
                                </goals>
                                <configuration>
                                    <skip>${maven.test.it.skip}</skip>
                                    <testClassesDirectory>${project.build.directory}/it-classes</testClassesDirectory>
                                    <includes>
                                        <include>com/atlassian/confluence/*AcceptanceTest.java</include>
                                    </includes>
                                    <excludes>
                                        <exclude>com/atlassian/confluence/SetupAcceptanceTest.java</exclude>
                                        <exclude>**/Abstract*.java</exclude>
                                        <exclude>com/atlassian/confluence/rpc/RpcLoadTest.java</exclude>
                                        <exclude>com/atlassian/confluence/AcceptanceTest*.java</exclude>
                                        <exclude>com/atlassian/confluence/KnownBugsAcceptanceTest.java</exclude>
                                    </excludes>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>


        <profile>
            <id>tomcat6</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.cargo</groupId>
                        <artifactId>cargo-maven2-plugin</artifactId>
                        <version>1.0-alpha-5</version>
                        <configuration>
                            <wait>${cargo.wait}</wait>
                            <container>
                                <containerId>tomcat6x</containerId>
                                <zipUrlInstaller>
                                    <url>https://m2proxy.atlassian.com/repository/internal/org/apache/tomcat/apache-tomcat/6.0.14/apache-tomcat-6.0.14.zip</url>
                                    <installDir>target/installs</installDir>
                                </zipUrlInstaller>
                            </container>
                        </configuration>
                    </plugin>
                </plugins>
            </build>

        </profile>

        <profile>
            <id>speed</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>50_acceptance_tests</id>
                                <phase>integration-test</phase>
                                <goals>
                                    <goal>test</goal>
                                </goals>
                                <configuration>
                                    <skip>${maven.test.it.skip}</skip>
                                    <testClassesDirectory>${project.build.directory}/it-classes</testClassesDirectory>
                                    <includes>
                                        <include>com/atlassian/confluence/*AcceptanceTest.java</include>
                                    </includes>
                                    <excludes>
                                        <exclude>com/atlassian/confluence/SetupAcceptanceTest.java</exclude>
                                        <exclude>**/Abstract*.java</exclude>
                                        <exclude>com/atlassian/confluence/rpc/RpcLoadTest.java</exclude>
                                        <exclude>com/atlassian/confluence/AcceptanceTest*.java</exclude>
                                        <exclude>com/atlassian/confluence/KnownBugsAcceptanceTest.java</exclude>
                                        <exclude>**/*JavaScript*.java</exclude>
                                        <exclude>**/*DashboardAcceptanceTest*.java</exclude>
                                        <exclude>**/*PeopleDirectoryAcceptanceTest*.java</exclude>
                                        <exclude>**/*Javascript*.java</exclude>
                                        <exclude>**/*PopupWindows*.java</exclude>
                                        <exclude>**/*ContentPermissionImportAcceptanceTest.java</exclude>
                                        <exclude>**/*HtmlExportAcceptanceTest.java</exclude>
                                        <exclude>**/*SiteImportAcceptanceTest*.java</exclude>
                                        <exclude>**/*InsertImage*Test.java</exclude>
                                        <exclude>**/*BrokenSpacePermissionsImportAcceptanceTest.java</exclude>
                                        <exclude>**/*BrokenSpacePermissionsImportAcceptanceTest.java</exclude>
                                        <exclude>**/*BlogSlowAcceptanceTest.java</exclude>
                                        <exclude>**/*ThumbnailAcceptanceTest.java</exclude>
                                        <!-- Possible candidates for removal -->
                                        <!--exclude>**/*AttachmentAcceptanceTest.java</exclude-->
                                    </excludes>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        

        <profile>
            <id>debug</id>
            <properties>
                <jvm.args>-XX:MaxPermSize=128M  -Djava.awt.headless=true -Xmx256m -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005</jvm.args>
            </properties>
        </profile>

        <profile>
            <id>jetty-exploded-war</id>
            <build>
                <defaultGoal>org.mortbay.jetty:maven-jetty-plugin:6.1.12.rc5:run-exploded</defaultGoal>
                <plugins>
                    <plugin>
                        <groupId>org.mortbay.jetty</groupId>
                        <artifactId>maven-jetty-plugin</artifactId>
                        <version>6.1.12.rc5</version>
                        <configuration>
                            <contextPath>${confluence.context}</contextPath>
                            <scanIntervalSeconds>10</scanIntervalSeconds>
                            <systemProperties>
                                <systemProperty>
                                    <name>confluence.home</name>
                                    <value>${project.build.directory}/confluence-home</value>
                                </systemProperty>
                                <systemProperty>
                                    <name>XX:MaxPermSize</name>
                                    <value>128M</value>
                                </systemProperty>
                                <systemProperty>
                                    <name>Xmx</name>
                                    <value>256M</value>
                                </systemProperty>
                            </systemProperties>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <skipTests>true</skipTests>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
            <properties>
                <http.port>8080</http.port>
                <jetty.port>${http.port}</jetty.port>
                <confluence.context>confluence</confluence.context>
            </properties>
        </profile>

        <!--<profile>-->
            <!--<id>for-cluster</id>-->
            <!--<properties>-->
                <!--<cache.implementation>confluence-cache-coherence</cache.implementation>-->
            <!--</properties>-->
        <!--</profile>-->
    </profiles>

    <properties>
        <!-- This should use ${project.build.directory} instead of target, but Maven < 2.0.9 fails to interpolate. -->
        <pluginBundleDirectory>target/bundled-plugins</pluginBundleDirectory>
        <cargo.wait>false</cargo.wait>
        <http.port>57362</http.port>
        <cargo.rmi.port>57363</cargo.rmi.port>
        <smtp.port>57364</smtp.port>
        <jvm.args>-XX:MaxPermSize=128M  -Djava.awt.headless=true -Xmx512m</jvm.args>
        <confluence.context>confluence</confluence.context>
        <confluence.url>http://localhost:${http.port}/${confluence.context}</confluence.url>
        <confluence.log.file.handlers>false</confluence.log.file.handlers>
        <clover.distributed.coverage>OFF</clover.distributed.coverage>
        <clover.server>false</clover.server>
    </properties>
</project>
