<?xml version="1.0" encoding="UTF-8"?>
<!--
  JBoss, Home of Professional Open Source
  Copyright 2013, 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-parent</artifactId>
        <version>5.0.0.Alpha2</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>richfaces-distribution</artifactId>
    <packaging>pom</packaging>
    <name>RichFaces Distribution Assembler</name>

    <properties>
        <version.richfaces>5.0.0.Alpha2</version.richfaces>
    </properties>

    <profiles>

        <profile>
            <id>release</id>

            <dependencies>
                <dependency>
                    <groupId>org.richfaces</groupId>
                    <artifactId>richfaces</artifactId>
                </dependency>

                <!-- Runtime Dependencies -->
                <dependency>
                    <groupId>net.sourceforge.cssparser</groupId>
                    <artifactId>cssparser</artifactId>
                </dependency>
                <dependency>
                    <groupId>com.google.guava</groupId>
                    <artifactId>guava</artifactId>
                </dependency>

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

                <!-- Examples -->
                <dependency>
                    <groupId>org.richfaces.examples</groupId>
                    <artifactId>richfaces-showcase</artifactId>
                    <version>${version.richfaces}</version>
                    <classifier>sources</classifier>
                </dependency>

                <!-- JSF impl -->
                <dependency>
                    <groupId>org.jboss.spec.javax.faces</groupId>
                    <artifactId>jboss-jsf-api_2.1_spec</artifactId>
                </dependency>

                <dependency>
                    <groupId>com.sun.faces</groupId>
                    <artifactId>jsf-impl</artifactId>
                </dependency>
            </dependencies>

            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>copy-bin</id>
                                <goals>
                                    <goal>copy-dependencies</goal>
                                </goals>
                                <phase>package</phase>
                                <configuration>
                                    <includeArtifactIds>richfaces</includeArtifactIds>
                                    <includeGroupIds>org.richfaces</includeGroupIds>
                                    <outputDirectory>target/dist/</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>copy-sources</id>
                                <goals>
                                    <goal>copy-dependencies</goal>
                                </goals>
                                <phase>package</phase>
                                <configuration>
                                    <classifier>sources</classifier>
                                    <includeArtifactIds>richfaces</includeArtifactIds>
                                    <includeGroupIds>org.richfaces</includeGroupIds>
                                    <outputDirectory>target/dist/</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>copy-deps</id>
                                <goals>
                                    <goal>copy-dependencies</goal>
                                </goals>
                                <phase>package</phase>
                                <configuration>
                                    <includeGroupIds>
                                        net.sourceforge.cssparser,
                                        org.w3c.css,
                                        com.google.guava
                                    </includeGroupIds>
                                    <outputDirectory>target/dist/lib</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>copy-deps-push</id>
                                <goals>
                                    <goal>copy-dependencies</goal>
                                </goals>
                                <phase>package</phase>
                                <configuration>
                                    <includeGroupIds>
                                        org.atmosphere
                                    </includeGroupIds>
                                    <outputDirectory>target/dist/lib/push</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>copy-deps-cache</id>
                                <goals>
                                    <goal>copy-dependencies</goal>
                                </goals>
                                <phase>package</phase>
                                <configuration>
                                    <includeGroupIds>
                                        net.sf.ehcache
                                    </includeGroupIds>
                                    <outputDirectory>target/dist/lib/cache</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>copy-javadoc</id>
                                <goals>
                                    <goal>unpack-dependencies</goal>
                                </goals>
                                <phase>package</phase>
                                <configuration>
                                    <classifier>javadoc</classifier>
                                    <stripVersion>true</stripVersion>
                                    <includeArtifactIds>richfaces</includeArtifactIds>
                                    <outputDirectory>target/dist/doc/javadoc</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>copy-vdldoc</id>
                                <goals>
                                    <goal>unpack-dependencies</goal>
                                </goals>
                                <phase>package</phase>
                                <configuration>
                                    <classifier>vdldoc</classifier>
                                    <stripVersion>true</stripVersion>
                                    <includeArtifactIds>richfaces</includeArtifactIds>
                                    <outputDirectory>target/dist/doc/vdldoc</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>copy-jsdoc</id>
                                <goals>
                                    <goal>unpack-dependencies</goal>
                                </goals>
                                <phase>package</phase>
                                <configuration>
                                    <classifier>jsdoc</classifier>
                                    <failOnMissingClassifierArtifact>false</failOnMissingClassifierArtifact>
                                    <stripVersion>true</stripVersion>
                                    <includeArtifactIds>richfaces</includeArtifactIds>
                                    <outputDirectory>target/dist/doc/jsdoc</outputDirectory>
                                </configuration>
                            </execution>

                            <execution>
                                <id>copy-examples</id>
                                <goals>
                                    <goal>unpack-dependencies</goal>
                                </goals>
                                <phase>package</phase>
                                <configuration>
                                    <includeArtifactIds>richfaces-showcase</includeArtifactIds>
                                    <failOnMissingClassifierArtifact>false</failOnMissingClassifierArtifact>
                                    <useSubDirectoryPerArtifact>false</useSubDirectoryPerArtifact>
                                    <stripVersion>true</stripVersion>
                                    <outputDirectory>target/dist/example/richfaces-showcase</outputDirectory>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <executions>
                            <execution>
                                <configuration>
                                    <finalName>richfaces-${version.richfaces}</finalName>
                                    <descriptor>src/main/resources/xml/richfaces.xml</descriptor>
                                    <appendAssemblyId>false</appendAssemblyId>
                                </configuration>
                                <id>richfaces</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>single</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
