<!--
        JBoss, Home of Professional Open Source Copyright 2010, Red Hat, Inc.
        and individual contributors by the @authors tag. See the copyright.txt
        in the distribution for a full listing of individual contributors.
        This is free software; you can redistribute it and/or modify it under
        the terms of the GNU Lesser General Public License as published by the
        Free Software Foundation; either version 2.1 of the License, or (at
        your option) any later version. This software is distributed in the
        hope that it will be useful, but WITHOUT ANY WARRANTY; without even
        the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
        PURPOSE. See the GNU Lesser General Public License for more details.
        You should have received a copy of the GNU Lesser General Public
        License along with this software; if not, write to the Free Software
        Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
        USA, or see the FSF site: http://www.fsf.org.
    -->
<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">

    <parent>
        <groupId>org.richfaces.core</groupId>
        <artifactId>richfaces-core-parent</artifactId>
        <version>4.3.0.20121024-M2</version>
        <relativePath>../parent/pom.xml</relativePath>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <artifactId>richfaces-core-impl</artifactId>
    <name>RichFaces Core Implementation</name>

    <description>
        The RichFaces Core Implementation.
    </description>

    <dependencies>
        <!-- Runtime Dependencies -->
        <dependency>
            <groupId>org.richfaces.core</groupId>
            <artifactId>richfaces-core-api</artifactId>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.cssparser</groupId>
            <artifactId>cssparser</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>

        <!-- Provided Dependencies -->
        <dependency>
            <groupId>javax.el</groupId>
            <artifactId>el-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.spec.javax.servlet</groupId>
            <artifactId>jboss-servlet-api_3.0_spec</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>jsp-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet.jsp.jstl</groupId>
            <artifactId>jstl-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- Cache Impls -->
        <dependency>
            <groupId>org.jboss.cache</groupId>
            <artifactId>jbosscache-core</artifactId>
            <optional>true</optional>
            <exclusions>
                <exclusion>
                    <artifactId>jboss-logging-spi</artifactId>
                    <groupId>org.jboss.logging</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>net.sf.ehcache</groupId>
            <artifactId>ehcache</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>opensymphony</groupId>
            <artifactId>oscache</artifactId>
            <optional>true</optional>
        </dependency>

        <!-- Push dependencies -->
        <dependency>
            <groupId>org.atmosphere</groupId>
            <artifactId>atmosphere-runtime</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>javax.jms</groupId>
            <artifactId>jms-api</artifactId>
            <optional>true</optional>
        </dependency>

        <!-- Test Dependencies -->
        <dependency>
            <groupId>org.jboss.test-jsf</groupId>
            <artifactId>htmlunit-client</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>javax.servlet</groupId>
                    <artifactId>javax.servlet-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.jboss.test-jsf</groupId>
            <artifactId>jsf-mock</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.easymock</groupId>
            <artifactId>easymock</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.easymock</groupId>
            <artifactId>easymockclassextension</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.test-jsf</groupId>
            <artifactId>jsf-mockito</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
                <filtering>true</filtering>
            </testResource>
        </testResources>
        <plugins>

            <plugin>
                <!-- Checkstyle only required here because suppressions needed -->
                <artifactId>maven-checkstyle-plugin</artifactId>
                <configuration>
                    <suppressionsLocation>${project.basedir}/richfaces-suppressions.xml</suppressionsLocation>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>buildnumber-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>create</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <doCheck>false</doCheck>
                    <doUpdate>false</doUpdate>
                    <revisionOnScmFailure>unknown</revisionOnScmFailure>
                    <timestampFormat>{0,date,MM/dd/yyyy h:mm:ss a}</timestampFormat>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <SCM-Revision>${buildNumber}</SCM-Revision>
                            <SCM-Timestamp>${timestamp}</SCM-Timestamp>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>**/integration/**/*.java</exclude>
                    </excludes>
                </configuration>
            </plugin>
        </plugins>
    </build>


    <profiles>
        <profile>
            <id>integration-tests</id>
            <activation>
                <property>
                    <name>integration</name>
                </property>
            </activation>
            <properties>
                <integration.test.source>src/test/integration</integration.test.source>

                <arquillian.drone.browser>htmlUnit</arquillian.drone.browser>
                <arquillian.drone.reusable>false</arquillian.drone.reusable>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.richfaces.test</groupId>
                    <artifactId>richfaces-arquillian</artifactId>
                    <scope>test</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>add-test-source</id>
                                <phase>process-test-sources</phase>
                                <goals>
                                    <goal>add-test-source</goal>
                                </goals>
                                <configuration>
                                    <sources>
                                        <source>${integration.test.source}</source>
                                    </sources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <version>2.12</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>integration-test</goal>
                                    <goal>integration-test</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <testSourceDirectory>${integration.test.source}</testSourceDirectory>
                            <includes>
                                <include>**/integration/**/*.java</include>
                            </includes>
                            <skipTests>${skipITs}</skipTests>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    
        <!-- Containers -->
        <profile>
            <id>container-jbossas-managed-7</id>
            <activation>
                <property>
                    <name>integration</name>
                    <value>jbossas</value>
                </property>
            </activation>
            <properties>
                <jbossHome>${project.build.directory}/jboss-as-${version.jboss-as7}</jbossHome>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.jboss.as</groupId>
                    <artifactId>jboss-as-arquillian-container-managed</artifactId>
                    <scope>test</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>unpack</id>
                                <phase>process-test-classes</phase>
                                <goals>
                                    <goal>unpack</goal>
                                </goals>
                                <configuration>
                                    <artifactItems>
                                        <artifactItem>
                                            <groupId>org.jboss.as</groupId>
                                            <artifactId>jboss-as-dist</artifactId>
                                            <version>${version.jboss-as7}</version>
                                            <type>zip</type>
                                            <overWrite>false</overWrite>
                                            <outputDirectory>${project.build.directory}</outputDirectory>
                                        </artifactItem>
                                    </artifactItems>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>default-test</id>
                                <goals>
                                    <goal>test</goal>
                                </goals>
                                <configuration>
                                    <systemPropertyVariables>
                                        <jbossHome>${jbossHome}</jbossHome>
                                    </systemPropertyVariables>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>container-jbossas-remote-7</id>
            <dependencies>
                <dependency>
                    <groupId>org.jboss.as</groupId>
                    <artifactId>jboss-as-arquillian-container-remote</artifactId>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>container-tomee-remote</id>
            <activation>
                <property>
                    <name>integration</name>
                    <value>tomee</value>
                </property>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.apache.openejb</groupId>
                    <artifactId>arquillian-tomee-remote</artifactId>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </profile>
        
        <!-- Browsers -->
        <profile>
            <id>browser-chrome</id>
            <properties>
                <arquillian.drone.browser>chrome</arquillian.drone.browser>
            </properties>
        </profile>
        <profile>
            <id>browser-firefox</id>
            <properties>
                <arquillian.drone.browser>firefox</arquillian.drone.browser>
            </properties>
        </profile>
        <profile>
            <id>browser-remote-reusable</id>
            <properties>
                <arquillian.drone.reusable>true</arquillian.drone.reusable>
            </properties>
        </profile>
        
        <!-- Release -->
        <profile>
            <id>release</id>
            <!-- TODO need to centralize - need to research first -->
            <build>
                <plugins>
                    <plugin>
                        <!--
                                  TODO - this can go to central, but should check settings. This is
                                  also related to docs so perhaps add to a doc profile Configure
                                  JavaScript Doc Tool
                              -->
                        <groupId>gr.abiss.mvn.plugins</groupId>
                        <artifactId>maven-jstools-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>jsdoc</id>
                                <configuration>
                                    <jsDir>${basedir}/src/main/resources/META-INF/resources</jsDir>
                                    <includes>**/*.js</includes>
                                    <caseSensitive>true</caseSensitive>
                                </configuration>
                                <goals>
                                    <goal>jsdoc</goal>
                                </goals>
                                <phase>process-sources</phase>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <!-- pack jsdoc to jar -->
                        <artifactId>maven-jar-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>pack-jsodcs</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                                <configuration>
                                    <classesDirectory>${basedir}/target/site/jsdoc</classesDirectory>
                                    <classifier>jsdoc</classifier>
                                    <excludes>
                                        <exclude>**/symbols/src/*</exclude>
                                    </excludes>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <scm>
        <connection>scm:git:git://github.com/richfaces/core.git</connection>
        <developerConnection>scm:git:git@github.com:richfaces/core.git</developerConnection>
        <url>https://github.com/richfaces/core</url>
    </scm>
</project>
