<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright The WildFly Authors
  ~ SPDX-License-Identifier: Apache-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.wildfly</groupId>
        <artifactId>mvc-krazo-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>2.0.0.Final</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <artifactId>wildfly-mvc-krazo-feature-pack</artifactId>
    <packaging>pom</packaging>

    <name>WildFly Jakarta MVC with Krazo -- Feature Pack</name>
    <description>Feature pack to provision Jakarta MVC with Krazo support for WildFly</description>

    <properties>
        <galleon.local.resources.directory>${project.basedir}/../galleon-local/src/main/resources</galleon.local.resources.directory>
        <galleon.shared.resources.directory>${project.basedir}/../galleon-shared/src/main/resources</galleon.shared.resources.directory>
        <license.directory>${project.build.directory}/resources/content/docs/licenses</license.directory>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.wildfly</groupId>
                <artifactId>wildfly-ee-galleon-pack</artifactId>
                <type>zip</type>
                <version>${version.org.wildfly}</version>
                <exclusions>
                    <exclusion>
                        <groupId>*</groupId>
                        <artifactId>*</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <!-- feature pack dependencies -->
        <dependency>
            <groupId>org.wildfly</groupId>
            <artifactId>wildfly-ee-galleon-pack</artifactId>
            <type>zip</type>
        </dependency>
         <dependency>
            <groupId>org.wildfly.galleon-plugins</groupId>
            <artifactId>wildfly-galleon-plugins</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.wildfly.galleon-plugins</groupId>
            <artifactId>wildfly-config-gen</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- module and copy artifact dependencies -->
        <dependency>
            <groupId>org.wildfly</groupId>
            <artifactId>mvc-krazo-galleon-shared</artifactId>
            <type>pom</type>
            <scope>provided</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-galleon-shared-resources</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${basedir}/target/resources</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>${galleon.shared.resources.directory}</directory>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>copy-galleon-local-resources</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${basedir}/target/resources</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>${galleon.local.resources.directory}</directory>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                    <execution>
                        <!-- Use copy-resources filtering to replace the GAV properties
                             in the wildfly-feature-pack-build.xml file with their values. -->
                        <id>filter-wildfly-feature-pack-build</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${basedir}/target</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>${project.basedir}</directory>
                                    <includes>
                                        <include>wildfly-feature-pack-build.xml</include>
                                    </includes>
                                    <filtering>true</filtering>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.wildfly.maven.plugins</groupId>
                <artifactId>licenses-plugin</artifactId>
                <inherited>false</inherited>
                <executions>
                    <execution>
                        <id>update-licenses-xml</id>
                        <goals>
                            <goal>insert-versions</goal>
                        </goals>
                        <phase>process-resources</phase>
                        <configuration>
                            <generateVersionProperty>true</generateVersionProperty>
                            <sortByGroupIdAndArtifactId>true</sortByGroupIdAndArtifactId>
                            <licensesConfigFiles>
                                <licensesConfigFile>${galleon.shared.resources.directory}/wildfly-mvc-krazo-license/licenses.xml</licensesConfigFile>
                            </licensesConfigFiles>
                            <licensesOutputFile>${license.directory}/wildfly-mvc-krazo-feature-pack-licenses.xml</licensesOutputFile>
                            <excludedGroups>org.wildfly.galleon-plugins</excludedGroups>
                            <excludedArtifacts>mvc-krazo-galleon-sharedpack\z</excludedArtifacts>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.wildfly.galleon-plugins</groupId>
                <artifactId>wildfly-galleon-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>wildfly-mvc-krazo-feature-pack-build</id>
                        <goals>
                            <goal>build-feature-pack</goal>
                        </goals>
                        <phase>prepare-package</phase>
                        <configuration>
                            <fork-embedded>${galleon.fork.embedded}</fork-embedded>
                            <generate-channel-manifest>true</generate-channel-manifest>
                            <minimum-stability-level>preview</minimum-stability-level>
                            <config-stability-level>preview</config-stability-level>
                            <package-stability-level>preview</package-stability-level>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
