<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>
    <artifactId>tomahawk-sandbox-examples</artifactId>
    <packaging>war</packaging>
    <name>Sandbox Examples</name>

    <parent>
        <groupId>org.apache.myfaces.tomahawk</groupId>
        <artifactId>sandbox-project</artifactId>
        <version>1.1.6</version>
    </parent>
    
    <scm>
        <connection>scm:svn:https://svn.apache.org/repos/asf/myfaces/tomahawk/branches/1_1_5</connection>
        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/myfaces/tomahawk/branches/1_1_5</developerConnection>
        <url>https://svn.apache.org/repos/asf/myfaces/tomahawk/branches/1_1_5</url>
    </scm>

    <profiles>
        <profile>
            <id>generate-assembly</id>
            <activation>
              <property>
                <name>performRelease</name>
                <value>true</value>
              </property>
            </activation>
            <build>        
                <plugins>	    
                    <plugin>	
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>dependency-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>unpack-source</id>
                                <phase>process-resources</phase>
                                <goals>
                                    <goal>unpack</goal>
                                </goals>
                                <configuration>
                                    <artifactItems>  	   
                                        <artifactItem>
                                            <groupId>org.apache.myfaces.tomahawk</groupId>
                                            <artifactId>${artifactId}</artifactId>
                                            <version>${version}</version>
                                            <classifier>sources</classifier>
                                        </artifactItem>
                                    </artifactItems>
                                    <outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/src</outputDirectory>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>	           
                </plugins>	
            </build>
        </profile>

        <!-- By default the war examples use myfaces! :) -->
        <profile>
            <id>myfaces</id>
            <activation>
                <property>
                    <name>!jsf</name>
                </property>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.apache.myfaces.core</groupId>
                    <artifactId>myfaces-api</artifactId>
                </dependency>
                <dependency>
                    <groupId>org.apache.myfaces.core</groupId>
                    <artifactId>myfaces-impl</artifactId>
                    <!-- Sandbox examples must only have runtime dependency to myfaces-impl
                 so that it will be automatically added to war. But there must not be
                 any compile dependency on impl so that is is always possible to use
                 other JSF implementations. -->
                    <scope>runtime</scope>
                </dependency>
            </dependencies>

            <properties>
                <jsf_implementation>MyFaces</jsf_implementation>
            </properties>
        </profile>

        <!-- To use the examples using the Sun's JSF Reference Implementation -->
        <profile>
            <id>jsfri</id>
            <activation>
                <property>
                    <name>jsf</name>
                    <value>ri</value>
                </property>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>javax.faces</groupId>
                    <artifactId>jsf-api</artifactId>
                    <version>1.1_02</version>
                </dependency>
                <dependency>
                    <groupId>javax.faces</groupId>
                    <artifactId>jsf-impl</artifactId>
                    <version>1.1_02</version>
                    <scope>runtime</scope>
                </dependency>

               <dependency>
                    <groupId>jstl</groupId>
                    <artifactId>jstl</artifactId>
                    <version>1.1.0</version>
                    <scope>compile</scope>
                </dependency>
            </dependencies>

            <repositories>
                <repository>
                    <id>java.net</id>
                    <name>java.net Maven 1 Repository</name>
                    <url>https://maven-repository.dev.java.net/nonav/repository</url>
                    <layout>legacy</layout>
                </repository>
            </repositories>

            <properties>
                <jsf_implementation>JSF-RI</jsf_implementation>
            </properties>
        </profile>

        <!-- Profile to run jetty, so the tomcat jars are included in the bundle. They are not included by default -->
        <profile>
            <id>jettyConfig</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.mortbay.jetty</groupId>
                        <artifactId>maven-jetty6-plugin</artifactId>
                        <configuration>
                            <scanIntervalSeconds>10</scanIntervalSeconds>
                        </configuration>
                    </plugin>
                </plugins>
            </build>

            <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>

            <pluginRepositories>
                <!-- Repository to get the jetty plugin -->
                <pluginRepository>
                    <id>mortbay-repo</id>
                    <name>mortbay-repo</name>
                    <url>http://www.mortbay.org/maven2/snapshot</url>
                </pluginRepository>
            </pluginRepositories>

        </profile>

    </profiles>

    <dependencies>
        <dependency>
            <groupId>org.apache.myfaces.tomahawk</groupId>
            <artifactId>tomahawk-sandbox</artifactId>
            <version>${version}</version>
        </dependency> 
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.0.4</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>cglib</groupId>
            <artifactId>cglib</artifactId>
            <version>2.1</version>
            <scope>runtime</scope>
        </dependency>
    </dependencies>

    <build>
        <finalName>${artifactId}</finalName>

        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>

    </build>

</project>
