<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.richfaces</groupId>
        <artifactId>richfaces-parent</artifactId>
        <version>4.5.1.Final</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>

    <groupId>org.richfaces.examples</groupId>
    <artifactId>richfaces-showcase</artifactId>
    <packaging>war</packaging>
    <name>RichFaces Showcase</name>

    <properties>
        <version.rf4.ui>4.5.1.Final</version.rf4.ui>
        <dependency.scope>compile</dependency.scope>
        <container.resources>src/main/resources-tomcat</container.resources>
        <container.resources.exclude />
        <container.webapp>src/main/webapp-tomcat</container.webapp>
        <war.outputFileNameMapping>@{artifactId}@@{dashClassifier?}@-@{version}@.@{extension}@</war.outputFileNameMapping>
        <javax.faces.PROJECT_STAGE>Development</javax.faces.PROJECT_STAGE>
        <mojarra.excluded.libraries>WEB-INF/lib/myfaces-*</mojarra.excluded.libraries>
        <myfaces.excluded.libraries>WEB-INF/lib/javax.faces*</myfaces.excluded.libraries>
        <jee6.excluded.libraries>
            ${mojarra.excluded.libraries},
            ${myfaces.excluded.libraries},
            WEB-INF/lib/jboss-jsf-api_2.1_spec*,
            WEB-INF/lib/jsf-impl*,
            WEB-INF/lib/jta*,
            WEB-INF/lib/jstl*,
            WEB-INF/lib/validation-api*,
            WEB-INF/lib/hibernate*,
            WEB-INF/lib/classmate*,
            WEB-INF/lib/jandex*,
            WEB-INF/lib/jboss-logging*,
            WEB-INF/lib/jboss-transaction-api*,
            WEB-INF/lib/antlr*,
            WEB-INF/lib/asm*,
            WEB-INF/lib/cglib*,
            WEB-INF/lib/commons-collections*,
            WEB-INF/lib/dom4j*,
            WEB-INF/lib/hsqldb*,
            WEB-INF/lib/javassist*,
            WEB-INF/lib/cdi-api*,
            WEB-INF/lib/javax.inject*,
            WEB-INF/lib/jboss-interceptors*,
            WEB-INF/lib/jsr250-api*,
            WEB-INF/lib/weld-servlet*
        </jee6.excluded.libraries>
        <jbas7.excluded.libraries>${jee6.excluded.libraries}</jbas7.excluded.libraries>
        <jbas71.excluded.libraries>${jbas7.excluded.libraries},WEB-INF/lib/jsr305*</jbas71.excluded.libraries>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.richfaces</groupId>
            <artifactId>richfaces</artifactId>
        </dependency>
        <dependency>
            <groupId>org.richfaces</groupId>
            <artifactId>richfaces-build-resources</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.richfaces</groupId>
            <artifactId>richfaces-page-fragments</artifactId>
            <scope>test</scope>
            <optional>true</optional>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jboss.spec.javax.servlet</groupId>
            <artifactId>jboss-servlet-api_3.0_spec</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.spec.javax.servlet.jsp</groupId>
            <artifactId>jboss-jsp-api_2.2_spec</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.spec.javax.el</groupId>
            <artifactId>jboss-el-api_2.2_spec</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.spec.javax.servlet.jstl</groupId>
            <artifactId>jboss-jstl-api_1.2_spec</artifactId>
            <scope>${dependency.scope}</scope>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <scope>${dependency.scope}</scope>
        </dependency>
        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
            <scope>${dependency.scope}</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <!-- API and Impl bundled in weld-servlet -->
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>net.sf.ehcache</groupId>
            <artifactId>ehcache</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hsqldb</groupId>
            <artifactId>hsqldb-j5</artifactId>
            <scope>${dependency.scope}</scope>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <scope>${dependency.scope}</scope>
        </dependency>

        <!-- Dependencies for Push -->
        <dependency>
            <groupId>org.richfaces</groupId>
            <artifactId>richfaces-push-depchain</artifactId>
            <type>pom</type>
        </dependency>

        <!-- Dependencies for CDI -->
        <dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
            <scope>${dependency.scope}</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.weld.servlet</groupId>
            <artifactId>weld-servlet</artifactId>
            <scope>${dependency.scope}</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.jboss.weld</groupId>
                    <artifactId>weld-build-config</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- The rewrite library allows us to do url rewriting - used here for rewriting mobile devices to mobile specific views -->
        <dependency>
            <groupId>org.ocpsoft.rewrite</groupId>
            <artifactId>rewrite-servlet</artifactId>
        </dependency>
        
        <!-- Jsoup used for validation of safe html input -->
        <dependency>
            <groupId>org.jsoup</groupId>
            <artifactId>jsoup</artifactId>
        </dependency>

        <!-- Test dependencies -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <finalName>richfaces-showcase</finalName>

        <resources>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
            <resource>
                <directory>${container.resources}</directory>
                <excludes>
                    <exclude>${container.resources.exclude}</exclude>
                </excludes>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <artifactId>maven-checkstyle-plugin</artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <classifier>${showcase.war.classifier}</classifier>
                    <outputFileNameMapping>${war.outputFileNameMapping}</outputFileNameMapping>
                    <webResources>
                        <resource>
                            <directory>${container.webapp}</directory>
                            <filtering>true</filtering>
                        </resource>
                        <resource>
                            <directory>src/main/java</directory>
                            <targetPath>WEB-INF/src</targetPath>
                        </resource>
                    </webResources>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <executions>
                    <execution>
                        <id>default-test</id>
                        <configuration>
                            <!--  there are no unit tests -->
                            <skipTests>true</skipTests>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <testFailureIgnore>true</testFailureIgnore>
                    <systemPropertyVariables>
                        <container.classifier>${showcase.war.classifier}</container.classifier>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>jsf_ri</id>
            <activation>
                <property>
                    <name>!jsf_profile</name>
                </property>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>javax.faces</groupId>
                    <artifactId>javax.faces-api</artifactId>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.glassfish</groupId>
                    <artifactId>javax.faces</artifactId>
                    <scope>${dependency.scope}</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>jsf_jboss</id>
            <activation>
                <property>
                    <name>jsf_profile</name>
                    <value>jboss</value>
                </property>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.jboss.spec.javax.faces</groupId>
                    <artifactId>jboss-jsf-api_2.1_spec</artifactId>
                    <scope>${dependency.scope}</scope>
                </dependency>
                <dependency>
                    <groupId>com.sun.faces</groupId>
                    <artifactId>jsf-impl</artifactId>
                    <scope>${dependency.scope}</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>myfaces</id>
            <activation>
                <property>
                    <name>jsf_profile</name>
                    <value>myfaces</value>
                </property>
            </activation>
            <properties>
                <showcase.war.classifier>myfaces</showcase.war.classifier>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.apache.myfaces.core</groupId>
                    <artifactId>myfaces-api</artifactId>
                    <scope>${dependency.scope}</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.myfaces.core</groupId>
                    <artifactId>myfaces-impl</artifactId>
                    <scope>${dependency.scope}</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>jee6</id>
            <properties>
                <showcase.war.classifier>jee6</showcase.war.classifier>
                <container.resources>src/main/resources-jee6</container.resources>
                <container.webapp>src/main/webapp-jee6</container.webapp>
                <dependency.scope>provided</dependency.scope>
            </properties>
        </profile>
        <profile>
            <id>jbas7</id>
            <properties>
                <showcase.war.classifier>jbas7</showcase.war.classifier>
                <container.resources>src/main/resources-jbas7</container.resources>
                <container.webapp>src/main/webapp-jbas7</container.webapp>
                <dependency.scope>provided</dependency.scope>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <!-- any changes in this plugin configuration should be repeated in the "release" profile executions -->
                        <artifactId>maven-war-plugin</artifactId>
                        <configuration>
                            <classifier>jbas7</classifier>
                            <webappDirectory>${project.build.directory}/${project.build.finalName}-jbas7
                            </webappDirectory>

                            <packagingExcludes>${jbas7.excluded.libraries}</packagingExcludes>
                            <warSourceExcludes>${jbas7.excluded.libraries}</warSourceExcludes>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.jboss.as.plugins</groupId>
                        <artifactId>jboss-as-maven-plugin</artifactId>
                        <configuration>
                            <filename>richfaces-showcase-jbas7.war</filename>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>jbas71</id>
            <properties>
                <showcase.war.classifier>jbas71</showcase.war.classifier>
                <container.resources>src/main/resources-jbas71</container.resources>
                <container.webapp>src/main/webapp-jbas71</container.webapp>
                <dependency.scope>provided</dependency.scope>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <!-- any changes in this plugin configuration should be repeated in the "release" profile executions -->
                        <artifactId>maven-war-plugin</artifactId>
                        <configuration>
                            <classifier>jbas71</classifier>
                            <webappDirectory>${project.build.directory}/${project.build.finalName}-jbas71
                            </webappDirectory>

                            <packagingExcludes>${jbas71.excluded.libraries}</packagingExcludes>
                            <warSourceExcludes>${jbas71.excluded.libraries}</warSourceExcludes>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.jboss.as.plugins</groupId>
                        <artifactId>jboss-as-maven-plugin</artifactId>
                        <version>7.1.1.Final</version>
                        <configuration>
                            <filename>richfaces-showcase-jbas71.war</filename>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>openshift</id>
            <properties>
                <showcase.war.classifier>openshift</showcase.war.classifier>
                <container.resources>src/main/resources-jbas7</container.resources>
                <container.webapp>src/main/webapp-openshift</container.webapp>
                <dependency.scope>provided</dependency.scope>
                <war.outputFileNameMapping>@{artifactId}@.@{extension}@</war.outputFileNameMapping>
            </properties>
        </profile>
        <profile>
            <id>release</id>
            <activation>
                <property>
                    <name>integration</name>
                </property>
            </activation>
            <properties>
                <container.resources.exclude>**</container.resources.exclude>
                <javax.faces.PROJECT_STAGE>Production</javax.faces.PROJECT_STAGE>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.apache.myfaces.core</groupId>
                    <artifactId>myfaces-api</artifactId>
                    <scope>${dependency.scope}</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.myfaces.core</groupId>
                    <artifactId>myfaces-impl</artifactId>
                    <scope>${dependency.scope}</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-war-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>default-war</id>
                                <configuration>
                                    <classifier>tomcat6</classifier>
                                    <webappDirectory>${project.build.directory}/${project.build.finalName}-tomcat6
                                    </webappDirectory>
                                    <packagingExcludes>
                                        ${mojarra.excluded.libraries}
                                    </packagingExcludes>
                                    <warSourceExcludes>
                                        ${mojarra.excluded.libraries}
                                    </warSourceExcludes>
                                    <webResources>
                                        <resource>
                                            <directory>src/main/webapp-tomcat</directory>
                                            <targetPath>/</targetPath>
                                            <filtering>true</filtering>
                                        </resource>
                                        <resource>
                                            <directory>src/main/resources-tomcat</directory>
                                            <targetPath>WEB-INF/classes</targetPath>
                                        </resource>
                                        <resource>
                                            <directory>src/main/java</directory>
                                            <targetPath>WEB-INF/src</targetPath>
                                        </resource>
                                    </webResources>
                                </configuration>
                            </execution>
                            <execution>
                                <id>myfaces</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>war</goal>
                                </goals>
                                <configuration>
                                    <classifier>myfaces</classifier>
                                    <webappDirectory>${project.build.directory}/${project.build.finalName}-myfaces
                                    </webappDirectory>
                                    <packagingExcludes>
                                        ${myfaces.excluded.libraries}
                                    </packagingExcludes>
                                    <warSourceExcludes>
                                        ${myfaces.excluded.libraries}
                                    </warSourceExcludes>
                                    <webResources>
                                        <resource>
                                            <directory>src/main/webapp-tomcat</directory>
                                            <targetPath>/</targetPath>
                                            <filtering>true</filtering>
                                        </resource>
                                        <resource>
                                            <directory>src/main/resources-tomcat</directory>
                                            <targetPath>WEB-INF/classes</targetPath>
                                        </resource>
                                        <resource>
                                            <directory>src/main/java</directory>
                                            <targetPath>WEB-INF/src</targetPath>
                                        </resource>
                                    </webResources>
                                </configuration>
                            </execution>
                            <execution>
                                <id>jee6</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>war</goal>
                                </goals>
                                <configuration>
                                    <classifier>jee6</classifier>
                                    <webappDirectory>${project.build.directory}/${project.build.finalName}-jee6
                                    </webappDirectory>

                                    <packagingExcludes>
                                        ${jee6.excluded.libraries}
                                    </packagingExcludes>
                                    <warSourceExcludes>
                                        ${jee6.excluded.libraries}
                                    </warSourceExcludes>
                                    <webResources>
                                        <resource>
                                            <directory>src/main/webapp</directory>
                                        </resource>
                                        <resource>
                                            <directory>src/main/webapp-tomcat</directory>
                                            <excludes>
                                                <exclude>**</exclude>
                                            </excludes>
                                        </resource>
                                        <resource>
                                            <directory>src/main/webapp-jee6</directory>
                                            <targetPath>/</targetPath>
                                            <filtering>true</filtering>
                                        </resource>
                                        <resource>
                                            <directory>src/main/resources-jee6</directory>
                                            <targetPath>WEB-INF/classes</targetPath>
                                        </resource>
                                        <resource>
                                            <directory>src/main/java</directory>
                                            <targetPath>WEB-INF/src</targetPath>
                                        </resource>
                                    </webResources>
                                </configuration>
                            </execution>
                            <execution>
                                <id>jbas7</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>war</goal>
                                </goals>
                                <configuration>
                                    <classifier>jbas7</classifier>
                                    <webappDirectory>${project.build.directory}/${project.build.finalName}-jbas7
                                    </webappDirectory>

                                    <packagingExcludes>${jbas7.excluded.libraries}</packagingExcludes>
                                    <warSourceExcludes>${jbas7.excluded.libraries}</warSourceExcludes>
                                    <webResources>
                                        <resource>
                                            <directory>src/main/webapp</directory>
                                        </resource>
                                        <resource>
                                            <directory>src/main/webapp-tomcat</directory>
                                            <excludes>
                                                <exclude>**</exclude>
                                            </excludes>
                                        </resource>
                                        <resource>
                                            <directory>src/main/webapp-jbas7</directory>
                                            <targetPath>/</targetPath>
                                            <filtering>true</filtering>
                                        </resource>
                                        <resource>
                                            <directory>src/main/resources-jbas7</directory>
                                            <targetPath>WEB-INF/classes</targetPath>
                                        </resource>
                                        <resource>
                                            <directory>src/main/java</directory>
                                            <targetPath>WEB-INF/src</targetPath>
                                        </resource>
                                    </webResources>
                                </configuration>
                            </execution>
                            <execution>
                                <id>jbas71</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>war</goal>
                                </goals>
                                <configuration>
                                    <classifier>jbas71</classifier>
                                    <webappDirectory>${project.build.directory}/${project.build.finalName}-jbas71
                                    </webappDirectory>

                                    <packagingExcludes>${jbas71.excluded.libraries}</packagingExcludes>
                                    <warSourceExcludes>${jbas71.excluded.libraries}</warSourceExcludes>
                                    <webResources>
                                        <resource>
                                            <directory>src/main/webapp</directory>
                                        </resource>
                                        <resource>
                                            <directory>src/main/webapp-tomcat</directory>
                                            <excludes>
                                                <exclude>**</exclude>
                                            </excludes>
                                        </resource>
                                        <resource>
                                            <directory>src/main/webapp-jbas71</directory>
                                            <targetPath>/</targetPath>
                                            <filtering>true</filtering>
                                        </resource>
                                        <resource>
                                            <directory>src/main/resources-jbas71</directory>
                                            <targetPath>WEB-INF/classes</targetPath>
                                        </resource>
                                        <resource>
                                            <directory>src/main/java</directory>
                                            <targetPath>WEB-INF/src</targetPath>
                                        </resource>
                                    </webResources>
                                </configuration>
                            </execution>
                            <execution>
                                <id>openshift</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>war</goal>
                                </goals>
                                <configuration>
                                    <classifier>openshift</classifier>
                                    <webappDirectory>${project.build.directory}/${project.build.finalName}-openshift
                                    </webappDirectory>
                                    <packagingExcludes>${jbas7.excluded.libraries}</packagingExcludes>
                                    <warSourceExcludes>${jbas7.excluded.libraries}</warSourceExcludes>
                                    <outputFileNameMapping>@{artifactId}@.@{extension}@</outputFileNameMapping>
                                    <webResources>
                                        <resource>
                                            <directory>src/main/webapp</directory>
                                        </resource>
                                        <resource>
                                            <directory>src/main/webapp-tomcat</directory>
                                            <excludes>
                                                <exclude>**</exclude>
                                            </excludes>
                                        </resource>
                                        <resource>
                                            <directory>src/main/webapp-openshift</directory>
                                            <targetPath>/</targetPath>
                                            <filtering>true</filtering>
                                        </resource>
                                        <resource>
                                            <directory>src/main/resources-jbas7</directory>
                                            <targetPath>WEB-INF/classes</targetPath>
                                        </resource>
                                        <resource>
                                            <directory>src/main/java</directory>
                                            <targetPath>WEB-INF/src</targetPath>
                                        </resource>
                                    </webResources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>group-sources</id>
                                <goals>
                                    <goal>single</goal>
                                </goals>
                                <phase>package</phase>
                                <configuration>
                                    <finalName>sources</finalName>
                                    <appendAssemblyId>false</appendAssemblyId>
                                    <descriptor>assembler.xml
                                    </descriptor>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-jar-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                                <phase>package</phase>
                                <configuration>
                                    <classesDirectory>${basedir}/target/sources/sources
                                    </classesDirectory>
                                    <classifier>sources</classifier>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>jrebel</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.zeroturnaround</groupId>
                        <artifactId>jrebel-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>generate-rebel-xml</id>
                                <phase>process-resources</phase>
                                <goals>
                                    <goal>generate</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
