<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ JBoss, Home of Professional Open Source.
  ~
  ~ Copyright 2024 Red Hat, Inc., and individual contributors
  ~ as indicated by the @author tags.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<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.jboss.resteasy.microprofile</groupId>
        <artifactId>resteasy-microprofile-parent</artifactId>
        <version>3.0.0.Final</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>

    <groupId>dev.resteasy.channels</groupId>
    <artifactId>resteasy-microprofile-3.0</artifactId>
    <name>RESTEasy MicroProfile: Channel Manifest</name>
    <packaging>pom</packaging>

    <properties>
        <generated.manifest.file>${project.build.directory}/resteasy-microprofile-${channel.stream.version}-${project.version}-manifest.yaml</generated.manifest.file>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.jboss.resteasy.microprofile</groupId>
                <artifactId>project-bom</artifactId>
                <version>${project.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <!-- Dependencies to include in the manifest -->
        <dependency>
            <groupId>org.eclipse.microprofile.rest.client</groupId>
            <artifactId>microprofile-rest-client-api</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.jboss.resteasy.microprofile</groupId>
            <artifactId>microprofile-config</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.jboss.resteasy.microprofile</groupId>
            <artifactId>microprofile-context-propagation</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.jboss.resteasy.microprofile</groupId>
            <artifactId>microprofile-rest-client</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.jboss.resteasy.microprofile</groupId>
            <artifactId>microprofile-rest-client-base</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.wildfly</groupId>
                <artifactId>wildfly-channel-maven-plugin</artifactId>
                <version>${version.org.wildfly.wildfly-channel-maven-plugin}</version>
                <executions>
                    <execution>
                        <id>generate-channel</id>
                        <phase>package</phase>
                        <goals>
                            <goal>create-manifest</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <manifestName>RESTEasy MicroProfile manifest version ${project.version}</manifestName>
                    <manifestId>${project.groupId}:${project.artifactId}</manifestId>
                    <manifestDescription>Manifest for RESTEasy MicroProfile feature pack.</manifestDescription>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>enforce-files-exist</id>
                        <phase>package</phase>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireFilesExist>
                                    <message>
                                        Expected file ${generated.manifest.file} to exist. If you have done a major or minor version bump, please ensure you updated to artifactId of ${project.artifactId} to resteasy-${channel.stream.version} in ${project.basedir}/pom.xml.
                                    </message>
                                    <files>
                                        <file>${generated.manifest.file}</file>
                                    </files>
                                </requireFilesExist>
                            </rules>
                            <fail>true</fail>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>