<?xml version="1.0" encoding="UTF-8"?>
<!--
~ JBoss, Home of Professional Open Source.
~ Copyright 2013, Red Hat, Inc., and individual contributors
~ as indicated by the @author tags. See the copyright.txt file 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.wildfly</groupId>
        <artifactId>wildfly-jsf-parent</artifactId>
        <!--
        Maintain separation between the artifact id and the version to help prevent
        merge conflicts between commits changing the GA and those changing the V.
        -->
        <version>20.0.0.Final</version>
    </parent>

    <artifactId>wildfly-jsf-installer</artifactId>
    <packaging>jar</packaging>

    <name>WildFly: JSF Multi-JSF installer</name>
    <description>Creates a CLI deployment archive that can install new JSF versions to WildFly.</description>

    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>wildfly-jsf-injection</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.weld.module</groupId>
            <artifactId>weld-jsf</artifactId>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>mojarra-2.x</id>
            <properties>
                <jsf-api-name>jsf-api</jsf-api-name>
                <jsf-impl-name>mojarra</jsf-impl-name>
                <jsf-version>2.2.18</jsf-version>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>com.sun.faces</groupId>
                    <artifactId>jsf-api</artifactId>
                    <version>${jsf-version}</version>
                </dependency>
                <dependency>
                    <groupId>com.sun.faces</groupId>
                    <artifactId>jsf-impl</artifactId>
                    <version>${jsf-version}</version>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>mojarra-2.3</id>
            <properties>
                <jsf-api-name>jboss-jsf-api_2.3_spec</jsf-api-name>
                <jsf-impl-name>mojarra</jsf-impl-name>
                <jsf-version>2.3.5.SP1</jsf-version>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.jboss.spec.javax.faces</groupId>
                    <artifactId>jboss-jsf-api_2.3_spec</artifactId>
                    <version>${jsf-version}</version>
                </dependency>
                <dependency>
                    <groupId>com.sun.faces</groupId>
                    <artifactId>jsf-impl</artifactId>
                    <version>${jsf-version}</version>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>mojarra-1.2</id>
            <properties>
                <jsf-api-name>jsf-api</jsf-api-name>
                <jsf-impl-name>mojarra</jsf-impl-name>
                <jsf-version>1.2_14</jsf-version>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>javax.faces</groupId>
                    <artifactId>jsf-api</artifactId>
                    <version>${jsf-version}</version>
                </dependency>
                <dependency>
                    <groupId>javax.faces</groupId>
                    <artifactId>jsf-impl</artifactId>
                    <version>${jsf-version}</version>
                </dependency>
            </dependencies>
        </profile>

        <profile>
            <id>myfaces</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <jsf-impl-name>myfaces</jsf-impl-name>
                <jsf-version>2.3.1</jsf-version>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.apache.myfaces.core</groupId>
                    <artifactId>myfaces-api</artifactId>
                    <version>${jsf-version}</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.myfaces.core</groupId>
                    <artifactId>myfaces-impl</artifactId>
                    <version>${jsf-version}</version>
                </dependency>
                <dependency>
                    <groupId>commons-digester</groupId>
                    <artifactId>commons-digester</artifactId>
                </dependency>
            </dependencies>
        </profile>
    </profiles>

    <build>
        <defaultGoal>assembly:single</defaultGoal>
        <finalName>install-${jsf-impl-name}-${jsf-version}</finalName>
        <plugins>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <id>make-jsf-instller</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <appendAssemblyId>false</appendAssemblyId>
                    <finalName>install-${jsf-impl-name}-${jsf-version}</finalName>
                    <descriptors>
                        <descriptor>src/main/assembly/src.xml</descriptor>
                    </descriptors>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
