<?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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <artifactId>booking</artifactId>
        <groupId>org.jboss.seam.examples-ee6</groupId>
        <version>2.3.0.Beta1</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    
    <groupId>org.jboss.seam.examples-ee6.booking</groupId>
    <artifactId>booking-web</artifactId>
    <packaging>war</packaging>
    <name>Booking Web Module</name>
    
    <properties>
        <!-- filtering property for components.xml -->
        <jndiPattern>java:app/booking-ejb/#{ejbName}</jndiPattern>
        <distributable>false</distributable>
    </properties>
    
    <dependencies>
        <dependency>
            <groupId>org.jboss.seam.examples-ee6.booking</groupId>
            <artifactId>booking-ejb</artifactId>
            <type>ejb</type>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.seam</groupId>
            <artifactId>jboss-seam-ui</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.jboss.seam</groupId>
                    <artifactId>jboss-seam-jul</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.jboss.seam</groupId>
            <artifactId>jboss-seam-debug</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-beanutils</groupId>
            <artifactId>commons-beanutils</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>commons-collections</groupId>
                    <artifactId>commons-collections</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
        </dependency>
        <dependency>
            <groupId>org.richfaces.ui</groupId>
            <artifactId>richfaces-components-ui</artifactId>
        </dependency>  
        <dependency>
            <groupId>org.richfaces.core</groupId>
            <artifactId>richfaces-core-impl</artifactId>
        </dependency>                           
    </dependencies>
  
    <build>
        <finalName>booking-web</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <webResources>
                        <resource>
                            <directory>src/main/webapp</directory>
                            <filtering>true</filtering>
                        </resource>
                    </webResources>
                </configuration>
            </plugin>
        </plugins>
    </build>
  
    <profiles>
        <profile>
            <id>cluster</id>
            <properties>
                <distributable>true</distributable>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-war-plugin</artifactId>
                        <configuration>
                            <webResources>
                                <resource>
                                    <directory>src/main/webapp</directory>
                                    <filtering>true</filtering>
                                    <excludes>
                                        <exclude>**/web.xml</exclude>
                                    </excludes>
                                </resource>
                                <resource>
                                    <directory>src/main/webapp-cluster</directory>
                                    <filtering>true</filtering>
                                </resource>
                            </webResources>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>tomcat</id>
            <properties>
                <!-- filtering property for components.xml -->
                <jndiPattern>#{ejbName}/local</jndiPattern>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.jboss.seam.examples-ee6.booking</groupId>
                    <artifactId>booking-ejb</artifactId>
                    <type>ejb</type>
                    <scope>compile</scope>
                </dependency>
                <dependency>
                    <groupId>org.jboss.seam</groupId>
                    <artifactId>jboss-seam</artifactId>
                    <type>ejb</type>
                    <scope>compile</scope>
                    <exclusions>
                        <exclusion>
                            <groupId>com.thoughtworks.xstream</groupId>
                            <artifactId>xstream</artifactId>
                        </exclusion>
                        <exclusion>
                            <groupId>xpp3</groupId>
                            <artifactId>xpp3_min</artifactId>
                        </exclusion>
                    </exclusions>
                </dependency>
                <dependency>
                    <groupId>javax.faces</groupId>
                    <artifactId>jsf-api</artifactId>
                    <scope>compile</scope>
                </dependency>
                <dependency>
                    <groupId>javax.faces</groupId>
                    <artifactId>jsf-impl</artifactId>
                    <scope>compile</scope>
                </dependency>
            </dependencies>
            <build>
                <finalName>jboss-seam-booking</finalName>
                <plugins>
                    <plugin>
                    <artifactId>maven-resources-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>copy-resources</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${basedir}/target/classes</outputDirectory>
                                    <resources>          
                                        <resource>
                                            <directory>${basedir}/../booking-ear/src/main/resources</directory>
                                            <includes>
                                                <include>jboss-seam-booking-ds.xml</include>
                                            </includes>
                                        </resource>
                                  </resources>              
                                </configuration>            
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
