<?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>wildfly-ee-feature-pack-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>40.0.0.Final</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>wildfly-ee-feature-pack-product-conf</artifactId>

    <name>WildFly: EE Feature-Pack Product Configuration</name>
    <description>Provides an artifact whose MANIFEST.MF includes entries that provide installation name and version information.</description>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <id>default-jar</id>
                        <phase>none</phase>
                    </execution>
                    <execution>
                        <id>jar</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <!-- This archive only has the manifest we generate. Turn off WARNs about that -->
                            <skipIfEmpty>false</skipIfEmpty>
                            <archive>
                                <manifestEntries>
                                    <JBoss-Product-Release-Name>${ee.dist.product.release.name}</JBoss-Product-Release-Name>
                                    <JBoss-Product-Release-Version>${ee.dist.product.release.version}</JBoss-Product-Release-Version>
                                    <JBoss-Product-Stability>${ee.dist.product.stability.level}</JBoss-Product-Stability>
                                    <JBoss-Product-Minimum-Stability>${ee.dist.product.min.stability.level}</JBoss-Product-Minimum-Stability>
                                </manifestEntries>
                            </archive>
                            <excludes>
                                <exclude>version.txt</exclude>
                            </excludes>
                        </configuration>
                    </execution>
                    <execution>
                        <id>empty-javadoc-jar</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <classifier>javadoc</classifier>
                            <classesDirectory>${project.basedir}/javadoc</classesDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <configuration>
                  <includePom>true</includePom>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>parse-versions</id>
                        <phase>initialize</phase>
                        <goals>
                            <goal>parse-version</goal>
                        </goals>
                        <configuration>
                            <propertyPrefix>release</propertyPrefix>
                        </configuration>
                    </execution>
                    <execution>
                        <id>attach-version-artifact</id>
                        <phase>package</phase>
                        <goals>
                            <goal>attach-artifact</goal>
                        </goals>
                        <configuration>
                            <artifacts>
                                <artifact>
                                    <file>${project.build.directory}/classes/version.txt</file>
                                    <type>txt</type>
                                    <classifier>version</classifier>
                                </artifact>
                            </artifacts>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
