<!--
/*
 * 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.
 *
 * $Id: pom.xml 661826 2008-05-30 19:19:56Z greddin $
 */
-->
<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.shale</groupId>
        <artifactId>shale-parent</artifactId>
        <version>1.0.5</version>
    </parent>
    <artifactId>shale-apps-parent</artifactId>
    <packaging>pom</packaging>
    <name>Apache Shale Framework Sample Apps</name>
    <url>http://shale.apache.org</url>


    <scm>
        <connection>scm:svn:http://svn.apache.org/repos/asf/shale/framework/tags/SHALE_1_0_5</connection>
        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/shale/framework/tags/SHALE_1_0_5</developerConnection>
        <url>http://svn.apache.org/viewvc/shale/framework/tags/SHALE_1_0_5</url>
    </scm>

    <distributionManagement>
        <site>
            <id>apache-site</id>
            <url>scp://people.apache.org/www/shale.apache.org/shale-apps</url>
        </site>
    </distributionManagement>


    <dependencies>
        <!-- Document "provided" dependencies to avoid cluttering WAR files -->
    </dependencies>

    <!-- Define dependency version numbers for commmonly used dependencies here,
         so that Maven finds them at a nearer "depth" than those defined in the
         org.apache.shale:shale-master POM.  WARNING - as you update versions
         here, be sure you also update them there. -->
    <dependencyManagement>

        <dependencies>

            <dependency>
                <groupId>commons-chain</groupId>
                <artifactId>commons-chain</artifactId>
                <version>1.1</version>
            </dependency>

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

            <dependency>
                <groupId>commons-digester</groupId>
                <artifactId>commons-digester</artifactId>
                <version>1.8</version>
            </dependency>

            <dependency>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
                <version>1.1</version>
            </dependency>

            <dependency>
                <groupId>commons-validator</groupId>
                <artifactId>commons-validator</artifactId>
                <version>1.3.1</version>
            </dependency>

        </dependencies>

    </dependencyManagement>

    <!-- TODO:  Move the 'itest' profile and dependencies to this pom when MNG-2221 is fixed. -->

    <profiles>
    <!-- 
    	A helpful profile when creating Eclipse configuration 
    	files for the Eclipse Web Tools project.
    	
    	For example:
    	 $ cd shale/framework
    	 $ mvn -Papps -Dwtpversion=1.0 eclipse:eclipse
    	
     -->
        <profile>
            <id>wtp-myfaces</id>
            <dependencies>
              <dependency>
                <groupId>org.apache.myfaces.core</groupId>
                <artifactId>myfaces-api</artifactId>
                <version>1.1.5</version>
                <scope>runtime</scope>
              </dependency>
              <dependency>
                <groupId>org.apache.myfaces.core</groupId>
                <artifactId>myfaces-impl</artifactId>
                <version>1.1.5</version>
                <scope>runtime</scope>
              </dependency>
            </dependencies>
        </profile>

        <!-- Profile for the Apache MyFaces JSF 1.1 Implementation -->
        <profile>
            <id>myfaces</id>
            <activation>
                <property>
                    <name>!jsf</name>
                </property>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.apache.myfaces.core</groupId>
                    <artifactId>myfaces-api</artifactId>
                    <version>1.1.5</version>
                    <scope>compile</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.myfaces.core</groupId>
                    <artifactId>myfaces-impl</artifactId>
                    <version>1.1.5</version>
                    <scope>runtime</scope>
                </dependency>
                <dependency>
                    <groupId>javax.servlet</groupId>
                    <artifactId>jsp-api</artifactId>
                    <version>2.0</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>javax.servlet</groupId>
                    <artifactId>servlet-api</artifactId>
                    <version>2.4</version>
                </dependency>
            </dependencies>
        </profile>

        <!-- Profile for the JSF 1.1 Reference Implementation -->
        <profile>
            <id>jsfri</id>
            <activation>
                <property>
                    <name>jsf</name>
                    <value>ri</value>
                </property>
            </activation>
            <dependencies>
                <!-- Force Commons Collections 3.1 so 2.1 is not selected -->
                <dependency>
                    <groupId>commons-collections</groupId>
                    <artifactId>commons-collections</artifactId>
                    <version>3.1</version>
                </dependency>
                <dependency>
                    <groupId>javax.faces</groupId>
                    <artifactId>jsf-api</artifactId>
                    <version>1.1_02</version>
                    <exclusions>
                      <exclusion>
                        <groupId>javax.servlet</groupId>
                        <artifactId>servlet-api</artifactId>
                      </exclusion>
                      <exclusion>
                        <groupId>javax.servlet.jsp</groupId>
                        <artifactId>jsp-api</artifactId>
                      </exclusion>
                    </exclusions>
                </dependency>
                <dependency>
                    <groupId>javax.faces</groupId>
                    <artifactId>jsf-impl</artifactId>
                    <version>1.1_02</version>
                    <scope>runtime</scope>
                    <exclusions>
                      <exclusion>
                        <groupId>javax.servlet</groupId>
                        <artifactId>servlet-api</artifactId>
                      </exclusion>
                      <exclusion>
                        <groupId>javax.servlet.jsp</groupId>
                        <artifactId>jsp-api</artifactId>
                      </exclusion>
                    </exclusions>
                </dependency>
                <dependency>
                    <groupId>javax.servlet</groupId>
                    <artifactId>servlet-api</artifactId>
                    <version>2.3</version>
                    <scope>provided</scope>
               </dependency>
               <!-- TODO Not Found -->
                <dependency>
                    <groupId>javax.servlet.jsp</groupId>
                    <artifactId>jsp-api</artifactId>
                    <version>1.2</version>
                    <scope>provided</scope>
               </dependency>
           </dependencies>
        </profile>

        <!-- Profile for JSF 1.2 on a Non-Java EE 5 Container (such as Tomcat 6.0) -->
        <profile>
            <id>jsfri12</id>
            <activation>
                <property>
                    <name>jsf</name>
                    <value>ri12</value>
                </property>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>javax.el</groupId>
                    <artifactId>el-api</artifactId>
                    <version>1.0</version>
                    <scope>provided</scope> <!-- JSP 2.1 requires it -->
                </dependency>
                <dependency>
                    <groupId>javax.faces</groupId>
                    <artifactId>jsf-api</artifactId>
                    <version>1.2_03</version>
                </dependency>
                <dependency>
                    <groupId>javax.faces</groupId>
                    <artifactId>jsf-impl</artifactId>
                    <version>1.2_03</version>
                    <scope>runtime</scope>
                </dependency>
                <dependency>
                    <groupId>javax.servlet</groupId>
                    <artifactId>servlet-api</artifactId>
                    <version>2.5</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>javax.servlet.jsp</groupId>
                    <artifactId>jsp-api</artifactId>
                    <version>2.1</version>
                    <scope>provided</scope>
                </dependency>
            </dependencies>
        </profile>

        <!-- Profile for JSF 1.2 on a Java EE 5 Container (such as Glassfish) -->
        <profile>
            <id>jsfee5</id>
            <activation>
                <property>
                    <name>jsf</name>
                    <value>ee5</value>
                </property>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>javax.el</groupId>
                    <artifactId>el-api</artifactId>
                    <version>1.0</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>javax.faces</groupId>
                    <artifactId>jsf-api</artifactId>
                    <version>1.2_03</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>javax.servlet</groupId>
                    <artifactId>servlet-api</artifactId>
                    <version>2.5</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>javax.servlet.jsp</groupId>
                    <artifactId>jsp-api</artifactId>
                    <version>2.1</version>
                    <scope>provided</scope>
                </dependency>
            </dependencies>
        </profile>

        <!-- Sample applications that depend on JDK 1.5 -->
        <profile>
            <activation>
                <jdk>1.5</jdk>
            </activation>
            <modules>
                <module>mailreader-jpa</module>
                <module>shale-mailreader-jpa</module>
                <module>shale-sql-browser</module>
                <module>shale-test-tiger</module>
            </modules>
        </profile>

        <!-- See http://shale.apache.org/shale-apps/selenium.html -->
        <profile>
            <id>selenium</id>
            <activation>
                <property>
                    <name>selenium</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>dependency-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>unpack-selenium</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>unpack</goal>
                                </goals>
                                <configuration>
                                    <artifactItems>
                                        <artifactItem>
                                            <groupId>org.openqa.selenium.core</groupId>
                                            <artifactId>selenium-core</artifactId>
                                            <version>0.7.0</version>
                                        </artifactItem>
                                    </artifactItems>
                                    <outputDirectory>${project.build.directory}/selenium</outputDirectory>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>copy-selenium</id>
                                <phase>process-resources</phase>
                                <configuration>
                                    <tasks>
                                        <copy todir="${project.build.directory}/${artifactId}/selenium/core">
                                            <fileset dir="${project.build.directory}/selenium/core" />
                                        </copy>
                                        <copy todir="${project.build.directory}/${artifactId}/selenium/tests">
                                            <fileset dir="${basedir}/src/test/selenium" />
                                        </copy>
                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
            <repositories>
                <repository>
                    <id>OpenQA</id>
                    <url>http://maven.openqa.org</url>
                </repository>
            </repositories>
        </profile>

        <!-- Profile to enable the Jetty plugin for testing -->
        <profile>
            <id>jetty</id>
            <build>
                <!-- Explicitly select Version 6.0.1, so we do not
                     get 6.0.1pre0 by default -->
                <plugins>
                    <plugin>
                        <groupId>org.mortbay.jetty</groupId>
                        <artifactId>maven-jetty-plugin</artifactId>
                        <version>6.0.1</version>
                    </plugin>
                </plugins>
            </build>
            <!-- Explicitly replace compile dependencies to pick up the
                Tomcat version of the Jasper compiler -->
            <dependencies>
                <dependency>
                    <groupId>javax.servlet</groupId>
                    <artifactId>jsp-api</artifactId>
                    <version>2.0</version>
                    <scope>compile</scope>
                </dependency>
                <dependency>
                    <groupId>tomcat</groupId>
                    <artifactId>jasper-compiler</artifactId>
                    <version>5.5.9</version>
                    <scope>compile</scope>
                </dependency>
                <dependency>
                    <groupId>tomcat</groupId>
                    <artifactId>jasper-runtime</artifactId>
                    <version>5.5.9</version>
                    <scope>compile</scope>
                </dependency>
                <dependency>
                    <groupId>tomcat</groupId>
                    <artifactId>jasper-compiler-jdt</artifactId>
                    <version>5.5.9</version>
                    <scope>compile</scope>
                </dependency>
            </dependencies>
        </profile>

    </profiles>

    <modules>
        <module>shale-blank</module> 
        <module>shale-mailreader</module>
        <module>shale-usecases</module>
        <module>shale-clay-usecases</module>
        <module>shale-test-core</module>
        <module>shale-test-dialog-basic</module>
        <module>shale-test-dialog-scxml</module>
        <module>shale-test-view</module>
    </modules>

    <build>
        <finalName>${artifactId}</finalName>
        <plugins>
            <plugin>
                <groupId>org.codehaus.cargo</groupId>
                <artifactId>cargo-maven2-plugin</artifactId>
                <configuration>
                    <container>
                        <containerId>tomcat5x</containerId>
                        <home>${cargo.tomcat5x.home}</home>
                        <log>${project.build.directory}/tomcat5x.log</log>
                        <output>${project.build.directory}/tomcat5x.out</output>
                    </container>
                    <configuration>
                        <home>${project.build.directory}/tomcat5x</home>
                    	<properties>
                    		<cargo.jvmargs> -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=n </cargo.jvmargs>
                    	</properties>
                    </configuration>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>
