<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (c) 2019, 2020 Oracle and/or its affiliates. All rights reserved.

    This program and the accompanying materials are made available under the
    terms of the Eclipse Public License v. 2.0, which is available at
    http://www.eclipse.org/legal/epl-2.0.

    This Source Code may also be made available under the following Secondary
    Licenses when the conditions for such availability set forth in the
    Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
    version 2 with the GNU Classpath Exception, which is available at
    https://www.gnu.org/software/classpath/license.html.

    SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0

-->

<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.glassfish.woodstock</groupId>
        <artifactId>woodstock-parent</artifactId>
        <version>5.0.0</version>
    </parent>

    <artifactId>woodstock-webui-jsf</artifactId>

    <name>Woodstock WebUI Jakarta Faces</name>

    <properties>
        <commons-fileupload-src-folder>${project.build.directory}/commons-fileupload-src</commons-fileupload-src-folder>
    </properties>

    <dependencies>
        <dependency>
            <groupId>jakarta.servlet</groupId>
            <artifactId>jakarta.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.faces</groupId>
            <artifactId>jakarta.faces-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.servlet.jsp</groupId>
            <artifactId>jakarta.servlet.jsp-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.el</groupId>
            <artifactId>jakarta.el-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.json</groupId>
            <artifactId>jakarta.json-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.woodstock</groupId>
            <artifactId>woodstock-dt</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>javax.help</groupId>
            <artifactId>javahelp</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-fileupload</groupId>
            <artifactId>commons-fileupload</artifactId>
            <version>${commons-fileupload.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.portlet</groupId>
            <artifactId>portlet-api</artifactId>
            <version>3.0.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.sun.faces.extensions</groupId>
            <artifactId>jsf-extensions-dynamic-faces</artifactId>
        </dependency>
        <dependency>
            <groupId>com.sun.faces.extensions</groupId>
            <artifactId>jsf-extensions-common</artifactId>
        </dependency>
        <dependency>
            <groupId>com.sun.woodstock.dependlibs</groupId>
            <artifactId>dataprovider</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <compilerArgs combine.children="append">
                        <arg>-Ataglibdoc=${basedir}/tag-descriptions.xml</arg>
                        <arg>-Ataglibdoc.out=META-INF/webui-jsf.tld</arg>
                        <arg>-Agenerate.designtime=false</arg>
                        <arg>-Agenerate.runtime=true</arg>
                        <arg>-Anamespace.prefix=webuijsf</arg>
                        <arg>-Anamespace.uri=http://www.sun.com/webui/webuijsf</arg>
                    </compilerArgs>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>com/sun/webui/jsf/design/*</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>3.1.2</version>
                <executions>
                    <execution>
                        <id>unpack_commons-fileupload_sources</id>
                        <phase>process-sources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>commons-fileupload</groupId>
                                    <artifactId>commons-fileupload</artifactId>
                                    <version>${commons-fileupload.version}</version>
                                    <classifier>sources</classifier>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>${commons-fileupload-src-folder}</outputDirectory>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <id>add-commons-fileupload-src</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${commons-fileupload-src-folder}</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.google.code.maven-replacer-plugin</groupId>
                <artifactId>replacer</artifactId>
                <version>1.5.3</version>
                <executions>
                    <execution>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>replace</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <includes>
                        <include>${commons-fileupload-src-folder}/**/*.java</include>
                    </includes>
                    <replacements>
                        <replacement>
                            <token>javax.servlet</token>
                            <value>jakarta.servlet</value>
                        </replacement>
                    </replacements>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
