<?xml version="1.0" encoding="utf-8"?>
<!--
    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">

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.richfaces</groupId>
        <artifactId>richfaces-root-parent</artifactId>
        <version>4.3.2.Final</version>
        <relativePath>../../build/parent/pom.xml</relativePath>
    </parent>

    <groupId>org.richfaces.ui</groupId>
    <artifactId>richfaces-ui-parent</artifactId>
    <name>RichFaces UI Components Parent</name>
    <packaging>pom</packaging>

    <properties>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>precompile-sources-for-cdk</id>
                            <phase>generate-sources</phase>
                            <goals>
                                <goal>compile</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.richfaces.cdk</groupId>
                    <artifactId>maven-cdk-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>cdk-generate-sources</id>
                            <phase>process-sources</phase>
                            <goals>
                                <goal>generate</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>add-source</id>
                            <phase>process-resources</phase>
                            <goals>
                                <goal>add-source</goal>
                            </goals>
                            <configuration>
                                <sources>
                                    <source>src/main/templates</source>
                                    <source>${project.build.directory}/generated-sources/main/java</source>
                                    <source>${project.build.directory}/generated-sources/main/resources</source>
                                </sources>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <configuration>
                    <rules>
                        <requirePluginVersions>
                            <!-- During development SNAPSHOT versions of the CDK plugin are used.
                                 This setting ignores the no SNAPSHOT rule for the CDK  -->
                            <unCheckedPluginList>org.richfaces.cdk:maven-cdk-plugin</unCheckedPluginList>
                        </requirePluginVersions>
                    </rules>
                </configuration>
            </plugin>
        </plugins>

    </build>

    <dependencies>
        <!-- runtime -->
        <dependency>
            <groupId>org.richfaces.core</groupId>
            <artifactId>richfaces-core-api</artifactId>
        </dependency>

        <dependency>
            <groupId>org.richfaces.cdk</groupId>
            <artifactId>annotations</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- JSF with dependencies -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>jsp-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.el</groupId>
            <artifactId>el-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet.jsp.jstl</groupId>
            <artifactId>jstl-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- tests -->
        <dependency>
            <groupId>org.richfaces.core</groupId>
            <artifactId>richfaces-core-impl</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.test-jsf</groupId>
            <artifactId>jsf-test-stage</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.test-jsf</groupId>
            <artifactId>htmlunit-client</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.test-jsf</groupId>
            <artifactId>jsf-mock</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>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <configuration>
                            <aggregate>true</aggregate>
                        </configuration>
                        <executions>
                            <execution>
                                <id>generate-source</id>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        
        <!-- Profile for quick CDK turnaround using JRebel and CDK command-line generator -->
        <profile>
            <id>jrebel</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>unpack-dependencies</id>
                                <phase>process-sources</phase>
                                <goals>
                                    <goal>unpack-dependencies</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <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>

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