<?xml version="1.0" encoding="UTF-8"?>
<!--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at
    
     http://www.apache.org/licenses/LICENSE-2.0
    
    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.
-->

<!-- $Rev$ $Date$ -->

<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>org.apache.geronimo</groupId>
        <artifactId>geronimo</artifactId>
        <version>2.1.9-SNAPSHOT</version>
    </parent>
    
    <groupId>org.apache.geronimo.testsuite</groupId>
    <artifactId>testsuite</artifactId>
    <name>Geronimo TestSuite</name>
    <packaging>pom</packaging>
    
    <description>
        Geronimo integration testsuite.
    </description>
    
    <dependencyManagement>
        <!-- mainatain the versioning of all dependencies in this one common location here. -->
        <dependencies>
            <!-- testsupport-selenium brings with it testsupport-common, selenium and testng dependencies -->
            <dependency>
                <groupId>org.apache.geronimo.testsupport</groupId>
                <artifactId>testsupport-selenium</artifactId>
                <version>${version}</version>
                <scope>compile</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.apache.geronimo.testsupport</groupId>
            <artifactId>testsupport-selenium</artifactId>
            <scope>provided</scope>
        </dependency>
    </dependencies>
    
    <modules>
        <module>commands-testsuite</module>
        <module>console-testsuite</module>
        <module>corba-testsuite</module>
        <module>deployment-testsuite</module>
        <module>enterprise-testsuite</module>
        <module>web-testsuite</module>
        <module>webservices-testsuite</module>
        <module>security-testsuite</module>
    </modules>
            
    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.geronimo.buildsupport</groupId>
                    <artifactId>testsuite-maven-plugin</artifactId>
                    <version>${version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-ear-plugin</artifactId>
                    <configuration>
                        <resourcesDir>${project.build.outputDirectory}</resourcesDir>
                    </configuration>
                </plugin>
                <!--
                     FIXME: Need to reset the default values here since our parent sets up wars
                     for use with jspc.  Remove once parent pom has been fixed.
                 -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <configuration>
                        <webXml>${pom.basedir}/src/main/webapp/WEB-INF/web.xml</webXml>
                        <webResources>
                            <resource>
                                <directory>${pom.basedir}/src/main/webapp</directory>
                                <filtering>true</filtering>
                            </resource>
                            <resource>
                                <directory>${project.build.outputDirectory}</directory>
                            </resource>
                        </webResources>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.3</version>
                    <configuration>
                        <skip>true</skip>
                    </configuration>
                    <executions>
                        <execution>
                            <id>test</id>
                            <phase>test</phase>
                            <goals>
                                <goal>test</goal>
                            </goals>
                            <configuration>
                                <skip>true</skip>
                            </configuration>
                        </execution>
                        <execution>
                            <id>integration</id>
                            <phase>integration-test</phase>
                            <goals>
                                <goal>test</goal>
                            </goals>
                            <configuration>
                                <testFailureIgnore>true</testFailureIgnore>
                                <skip>false</skip>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.geronimo.genesis.plugins</groupId>
                    <artifactId>maven-maven-plugin</artifactId>
                    <version>1.3</version>
                    <configuration>
                        <fileset>
                            <basedir>${pom.basedir}</basedir>
                            <includes>
                                <include>*/pom.xml</include>
                            </includes>
                        </fileset>
                        <profiles>
                            <profile>child</profile>
                        </profiles>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>integration-test</phase>
                            <goals>
                                <goal>invoke</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>site-deploy</id>
                            <phase>site-deploy</phase>
                            <goals>
                                <goal>invoke</goal>
                            </goals>
                            <configuration>
                                <goals>
                                    <goal>site-deploy</goal>
                                </goals>
                                <parameters>
                                    <buildNumber>${buildNumber}</buildNumber>
                                </parameters>
                            </configuration>
                        </execution>
                        <execution>
                            <id>clean</id>
                            <phase>clean</phase>
                            <goals>
                                <goal>invoke</goal>
                            </goals>
                            <configuration>
                                <goals>
                                    <goal>clean</goal>
                                </goals>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.geronimo.buildsupport</groupId>
                    <artifactId>geronimo-maven-plugin</artifactId>
                    <configuration>
                        <reporters>
                            <reporter implementation="org.apache.geronimo.mavenplugins.geronimo.reporting.SurefireReporter">
                                <reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
                            </reporter>
                        </reporters>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>selenium-maven-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>start-server</id>
                            <phase>pre-integration-test</phase>
                            <goals>
                                <goal>start-server</goal>
                            </goals>
                            <configuration>
                                <logOutput>true</logOutput>
                                <background>true</background>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>
            
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>ianal-maven-plugin</artifactId>
                <configuration>
                    <!-- Don't bother checking legal muck here, we never publish them. -->
                    <skip>true</skip>
                </configuration>
            </plugin>
            
            <!-- Add this so that this should not get deployed during release plugin processing-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <distributionManagement>
        <site>
            <id>website</id>
            <url>scp://people.apache.org/www/people.apache.org/builds/geronimo/server/testsuite/${buildNumber}</url>
        </site>
    </distributionManagement>
    
    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.geronimo.buildsupport</groupId>
                <artifactId>testsuite-maven-plugin</artifactId>
            </plugin>
            <!-- This should actually be configured in genesis:project-config -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.1</version>
                <configuration>
                    <source>1.5</source>
                </configuration>
            </plugin>
        </plugins>
    </reporting>
    
    <profiles>
        <profile>
            <id>default</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>

                        <plugin>
                            <groupId>org.apache.geronimo.buildsupport</groupId>
                            <artifactId>geronimo-maven-plugin</artifactId>
                            <executions>
                                <execution>
                                    <id>start-server</id>
                                    <phase>pre-integration-test</phase>
                                    <goals>
                                        <goal>start-server</goal>
                                    </goals>
                                    <configuration>
                                        <logOutput>true</logOutput>
                                        <background>true</background>
                                        <verifyTimeout>300</verifyTimeout>
                                        <optionSets>
                                            <optionSet>
                                                <id>default</id>
                                                <options>
                                                   <option>-XX:MaxPermSize=128m</option>
                                                </options>
                                            </optionSet>
                                        </optionSets>
                                    </configuration>
                                </execution>
                                <execution>
                                    <id>stop-server</id>
                                    <phase>install</phase>
                                    <goals>
                                        <goal>stop-server</goal>
                                    </goals>
                                </execution>
                            </executions>
                        </plugin>
                    </plugins>
                </pluginManagement>

                <plugins>
                    <plugin>
                        <groupId>org.apache.geronimo.buildsupport</groupId>
                        <artifactId>testsuite-maven-plugin</artifactId>
                        <inherited>false</inherited>
                        <executions>
                            <execution>
                                <id>summarize</id>
                                <phase>post-site</phase>
                                <goals>
                                    <goal>summarize</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>headless</id>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.codehaus.mojo</groupId>
                            <artifactId>selenium-maven-plugin</artifactId>
                            <executions>
                                <execution>
                                    <id>xvfb</id>
                                    <phase>process-test-sources</phase>
                                    <goals>
                                        <goal>xvfb</goal>
                                    </goals>
                                </execution>
                            </executions>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
        

        <profile>
            <id>common</id>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.apache.geronimo.buildsupport</groupId>
                            <artifactId>geronimo-maven-plugin</artifactId>
                            <executions>
                                <execution>
                                    <id>start-server</id>
                                    <phase>pre-integration-test</phase>
                                    <goals>
                                        <goal>start-server</goal>
                                    </goals>
                                    <configuration>
                                        <logOutput>true</logOutput>
                                        <background>true</background>
                                        <installDirectory>${basedir}/../server</installDirectory>
                                    </configuration>
                                </execution>
                            </executions>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
        
        <profile>
            <id>child</id>
        </profile>
        
        <profile>
            <!-- use for things like versions:set and perhaps release when build has to run on all projects -->
            <id>all-subprojects</id>
        </profile>
    </profiles>

</project>
