<?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: 1357053 $ $Date: 2012-07-04 11:22:09 +0800 (Wed, 04 Jul 2012) $ -->

<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.genesis</groupId>
        <artifactId>genesis-java6-flava</artifactId>
        <version>2.0</version>
    </parent>

    <groupId>org.apache.geronimo.samples</groupId>
    <artifactId>samples-parent</artifactId>
    <name>Geronimo Samples :: Parent</name>
    <version>3.0.0</version>
    <packaging>pom</packaging>

    <description>
        Geronimo Samples.
    </description>

    <scm>
        <connection>scm:svn:http://svn.apache.org/repos/asf/geronimo/samples/tags/samples-parent-3.0.0</connection>
        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/geronimo/samples/tags/samples-parent-3.0.0</developerConnection>
        <url>http://svn.apache.org/viewvc/geronimo/samples/tags/samples-parent-3.0.0</url>
    </scm>

    <properties>
        <geronimoVersion>3.0.0</geronimoVersion>
        <siteId>geronimo-samples</siteId>
        <projectName>Apache Geronimo Samples</projectName>
        <jetty>jetty8</jetty>
        <tomcat>tomcat7</tomcat>
        <myfacesVersion>2.0.9_1</myfacesVersion>
        <derbyVersion>10.8.2.2_1</derbyVersion>
    </properties>

    <url>http://geronimo.apache.org/maven/${siteId}/${version}</url>
    <distributionManagement>
        <site>
            <id>geronimo-website</id>
            <url>${staging.siteURL}/${siteId}/${version}</url>
        </site>
    </distributionManagement>

    <repositories>
        <!--
          NOTE: The default repositories are picked up by Genesis, but need to
                specify where Genesis lives to pickup snapshot versions.  -->
        <repository>
            <id>apache-snapshots</id>
            <name>Apache Snapshots Repository</name>
            <url>http://repository.apache.org/snapshots</url>
            <layout>default</layout>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>daily</updatePolicy>
                <checksumPolicy>ignore</checksumPolicy>
            </snapshots>
            <releases>
                <enabled>false</enabled>
            </releases>
        </repository>
      
        <!--
          NOTE: The following shows how to point to a locally installed
                Geronimo Server for using artifacts already on a machine
                instead of downloading them from remote repositories.
        -->
        <!--
        <repository>
            <id>geronimo-server</id>
            <name>Local Apache Geronimo Server Repository</name>
            <url>file://~/geronimo-tomcat6-javaee5-2.2/repository</url>
            <layout>default</layout>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
            </releases>
        </repository>
        -->
        <repository>
                    <id>openqa-snapshots</id>
                    <name>Openqa Snapshot Repository</name>
                    <url>http://nexus.openqa.org/content/repositories/snapshots</url>
                    <layout>default</layout>
                    <snapshots>
                        <enabled>true</enabled>
                        <updatePolicy>daily</updatePolicy>
                        <checksumPolicy>ignore</checksumPolicy>
                    </snapshots>
                    <releases>
                        <enabled>false</enabled>
                    </releases>
                </repository>
                 
    </repositories>

    <pluginRepositories>
        <!-- required for clean build unless you want to bootstrap the car-maven-plugin -->
        <pluginRepository>
            <id>apache.snapshots</id>
            <name>Apache Snapshots Repository</name>
            <url>http://repository.apache.org/snapshots</url>
            <layout>default</layout>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>daily</updatePolicy>
                <checksumPolicy>ignore</checksumPolicy>
            </snapshots>
            <releases>
                <enabled>false</enabled>
            </releases>
        </pluginRepository>
    </pluginRepositories>
    
    <modules>
        <module>buildutil</module>
        <module>geronimo-samples-archetype</module>
        <module>samples</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <!-- Import Geronimo Server used dependency versions -->
            <dependency>
                <groupId>org.apache.geronimo</groupId>
                <artifactId>geronimo</artifactId>
                <version>${geronimoVersion}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!-- Import ActiveMQ dependency versions -->
            <dependency>
                <groupId>org.apache.geronimo.plugins</groupId>
                <artifactId>activemq</artifactId>
                <version>${geronimoVersion}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!-- Import MyFaces dependency versions -->
            <dependency>
                <groupId>org.apache.geronimo.plugins</groupId>
                <artifactId>myfaces</artifactId>
                <version>${geronimoVersion}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            
            <!-- Import System-database dependency versions -->
            <dependency>
                <groupId>org.apache.geronimo.plugins</groupId>
                <artifactId>system-database</artifactId>
                <version>${geronimoVersion}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            
            <dependency>
            <groupId>org.apache.myfaces.core</groupId>
            <artifactId>myfaces-api</artifactId>
            <version>${myfacesVersion}</version>
        </dependency>
        
         <dependency>
            <groupId>org.apache.myfaces.core</groupId>
            <artifactId>myfaces-bundle</artifactId>
            <version>${myfacesVersion}</version>
        </dependency>
        
        <dependency>
                <groupId>org.apache.geronimo.bundles</groupId>
                <artifactId>derby-all</artifactId>
                <version>${derbyVersion}</version>
            </dependency>

        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.geronimo.buildsupport</groupId>
                    <artifactId>geronimo-maven-plugin</artifactId>
                    <version>${geronimoVersion}</version>

                    <configuration>
                        <assemblies>
                            <assembly>
                                <id>jetty</id>
                                <groupId>org.apache.geronimo.assemblies</groupId>
                                <artifactId>geronimo-${jetty}-javaee5</artifactId>
                                <version>${geronimoVersion}</version>
                                <classifier>bin</classifier>
                                <type>zip</type>
                            </assembly>

                            <assembly>
                                <id>jetty-minimal</id>
                                <groupId>org.apache.geronimo.assemblies</groupId>
                                <artifactId>geronimo-${jetty}-minimal</artifactId>
                                <version>${geronimoVersion}</version>
                                <classifier>bin</classifier>
                                <type>zip</type>
                            </assembly>

                            <assembly>
                                <id>tomcat</id>
                                <groupId>org.apache.geronimo.assemblies</groupId>
                                <artifactId>geronimo-tomcat6-javaee5</artifactId>
                                <version>${geronimoVersion}</version>
                                <classifier>bin</classifier>
                                <type>zip</type>
                            </assembly>

                            <assembly>
                                <id>tomcat-minimal</id>
                                <groupId>org.apache.geronimo.assemblies</groupId>
                                <artifactId>geronimo-tomcat6-minimal</artifactId>
                                <version>${geronimoVersion}</version>
                                <classifier>bin</classifier>
                                <type>zip</type>
                            </assembly>

                            <assembly>
                                <id>framework</id>
                                <groupId>org.apache.geronimo.assemblies</groupId>
                                <artifactId>geronimo-framework</artifactId>
                                <version>${geronimoVersion}</version>
                                <classifier>bin</classifier>
                                <type>zip</type>
                            </assembly>
                        </assemblies>

                        <defaultAssemblyId>framework</defaultAssemblyId>

                        <optionSets>
                            <optionSet>
                                <id>morememory</id>
                                <options>
                                    <option>-Xmx512m</option>
                                    <option>-XX:MaxPermSize=128m</option>
                                </options>
                            </optionSet>

                            <optionSet>
                                <id>debug</id>
                                <options>
                                    <option>-Xdebug</option>
                                    <option>-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n</option>
                                </options>
                            </optionSet>
                        </optionSets>
                    </configuration>
                    <executions>
                         <execution>
                             <id>start</id>
                             <phase>pre-integration-test</phase>
                             <goals>
                                 <goal>start-server</goal>
                             </goals>
                             <configuration>
                                 <assemblyId>${it-server}</assemblyId>
                                 <logOutput>true</logOutput>
                                 <background>true</background>
                                 <verifyTimeout>300</verifyTimeout>
                                 <refresh>true</refresh>
                                 <optionSets>
                                     <optionSet>
                                         <id>default</id>
                                         <options>
                                            <option>-XX:MaxPermSize=128m</option>
                                         </options>
                                     </optionSet>

                                     <optionSet>
                                          <id>morememory</id>
                                          <options>
                                              <option>-Xmx512m</option>
                                              <option>-XX:MaxPermSize=128m</option>
                                          </options>
                                      </optionSet>

                                      <optionSet>
                                          <id>debug</id>
                                          <options>
                                              <option>-Xdebug</option>
                                              <option>-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n</option>
                                          </options>
                                      </optionSet>
                                 </optionSets>
                             </configuration>
                         </execution>
                         <execution>
                             <id>install-plugin</id>
                             <phase>install</phase>
                             <goals>
                                 <goal>install-plugin</goal>
                             </goals>
                             <!--<configuration>-->
                                 <!--<defaultGeronimoRepository>http://geronimo.apache.org/plugins/geronimo-${geronimoVersion}/</defaultGeronimoRepository>-->
                             <!--</configuration>-->
                         </execution>
                         <execution>
                             <id>stop</id>
                             <phase>install</phase>
                             <goals>
                                 <goal>stop-server</goal>
                             </goals>
                         </execution>
                     </executions>
                </plugin>                
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>                
                <configuration>                    
                    <debug>true</debug>
                    <source>1.5</source>                  
                    <target>1.5</target>
                </configuration>
            </plugin>            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <!-- Allow any Java >= 1.5 -->
                                <requireJavaVersion>
                                    <version>[1.5,)</version>
                                </requireJavaVersion>
                                
                                <!-- Require Maven 2.0.9+ -->
                                <requireMavenVersion>
                                    <version>[2.0.9,)</version>
                                </requireMavenVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            
            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <version>2.4.1</version>
                <configuration>
                <filesets>
                    <fileset>
                        <directory>src/main</directory>
                        <includes>
                            <include>history</include>                            
                        </includes>
                        <!--<excludes>
                            <exclude>**/important.log</exclude>
                            <exclude>**/another-important.log</exclude>
                        </excludes>-->
                        <followSymlinks>false</followSymlinks>
                    </fileset>
                </filesets>
                </configuration>
        </plugin>            
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>rat-check</id>
            <build>
                <plugins>            
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>rat-maven-plugin</artifactId>
                        <version>1.0-alpha-3</version>
                        <configuration>
                            <excludes>
                                <exclude>src/main/history/dependencies.xml</exclude>
                                <exclude>release.properties</exclude>
                                <exclude>pom.xml.releaseBackup</exclude>
                                <exclude>target/**/*</exclude>
                            </excludes>
                        </configuration>
                        <executions>
                            <execution>
                                <phase>validate</phase>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>          
        </profile>
    </profiles>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <configuration>
                    <targetJdk>1.5</targetJdk>
                </configuration>
            </plugin>
        </plugins>
    </reporting>    
</project>
