<?xml version="1.0" encoding="UTF-8"?>
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <groupId>be.e-contract</groupId>
        <artifactId>enterprise-jsf</artifactId>
        <version>1.34.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <groupId>be.e-contract.enterprise-jsf</groupId>
    <artifactId>ejsf-api</artifactId>
    <name>Enterprise JSF API</name>
    <dependencies>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
        </dependency>
    </dependencies>
    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <excludes>
                    <exclude>META-INF/beans-ee10.xml</exclude>
                </excludes>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <executions>
                    <execution>
                        <id>jakarta</id>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <shadedArtifactAttached>true</shadedArtifactAttached>
                            <shadedClassifierName>jakarta</shadedClassifierName>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                            <artifactSet>
                                <includes>
                                    <include>${project.groupId}:${project.artifactId}</include>
                                </includes>
                            </artifactSet>
                            <relocations>
                                <relocation>
                                    <pattern>javax.enterprise</pattern>
                                    <shadedPattern>jakarta.enterprise</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>javax.inject</pattern>
                                    <shadedPattern>jakarta.inject</shadedPattern>
                                </relocation>
                            </relocations>
                            <transformers>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.DontIncludeResourceTransformer">
                                    <resource>META-INF/beans.xml</resource>
                                </transformer>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
                                    <resource>META-INF/beans.xml</resource>
                                    <file>${basedir}/src/main/resources/META-INF/beans-ee10.xml</file>
                                </transformer>
                            </transformers>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
