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

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

    This program and the accompanying materials are made available under the
    terms of the Eclipse Distribution License v. 1.0, which is available at
    http://www.eclipse.org/org/documents/edl-v10.php.

    SPDX-License-Identifier: BSD-3-Clause

-->

<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">
    <parent>
        <groupId>com.guicedee.services</groupId>
        <artifactId>services-parent</artifactId>
        <version>62</version>
    </parent>

    <modelVersion>4.0.0</modelVersion>

    <artifactId>jakarta.xml.bind-api</artifactId>
    <packaging>jar</packaging>
    <name>jaxb</name>

    <properties>
        <config.dir>${project.basedir}/../etc/config</config.dir>
        <legal.doc.source>${project.basedir}/..</legal.doc.source>
    </properties>

    <dependencies>

        <dependency>
            <groupId>com.guicedee.services</groupId>
            <artifactId>jakarta.activation</artifactId>
            <type>jar</type>
        </dependency>


        <dependency>
            <groupId>com.guicedee.services</groupId>
            <artifactId>jakarta.validation-api</artifactId>
            <type>jar</type>
        </dependency>

        <dependency>
            <groupId>jakarta.xml.bind</groupId>
            <artifactId>jakarta.xml.bind-api</artifactId>
            <version>2.3.2</version>
            <exclusions>
                <exclusion>
                    <artifactId>jakarta.activation-api</artifactId>
                    <groupId>jakarta.activation</groupId>
                </exclusion>
            </exclusions>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>org.glassfish.jaxb</groupId>
            <artifactId>jaxb-runtime</artifactId>
            <version>2.3.1</version>
            <exclusions>
                <exclusion>
                    <artifactId>javax.activation-api</artifactId>
                    <groupId>javax.activation</groupId>
                </exclusion>
            </exclusions>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-impl</artifactId>
            <version>2.4.0-b180830.0438</version>
            <optional>true</optional>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.codehaus.woodstox/stax2-api -->
        <dependency>
            <groupId>org.codehaus.woodstox</groupId>
            <artifactId>stax2-api</artifactId>
            <version>4.2</version>
        </dependency>
        <dependency>
            <groupId>org.jvnet.staxex</groupId>
            <artifactId>stax-ex</artifactId>
            <version>1.8.2</version>
        </dependency>


    </dependencies>

    <build>
        <plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${maven.jar.version}</version>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Multi-Release>true</Multi-Release>
                        </manifestEntries>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-shade-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <createDependencyReducedPom>false</createDependencyReducedPom>
                    <createSourcesJar>true</createSourcesJar>
                    <shadeSourcesContent>true</shadeSourcesContent>
                    <shadeTestJar>true</shadeTestJar>
                    <keepDependenciesWithProvidedScope>false</keepDependenciesWithProvidedScope>

                    <artifactSet>
                        <includes>
                            <include>jakarta.xml.bind:jakarta.xml.bind-api:*</include>
                            <include>org.glassfish.jaxb:jaxb-runtime:*</include>
                            <include>javax.xml.bind:jaxb-api:*</include>
                            <include>org.glassfish.jaxb:txw2:*</include>
                            <include>com.sun.istack:istack-commons-runtime:*</include>
                            <!--<include>org.jvnet.staxex:stax-ex:*</include>-->
                            <include>com.sun.xml.fastinfoset:FastInfoset:*</include>
                            <include>com.sun.xml.bind:jaxb-impl:*</include>
                        </includes>
                    </artifactSet>
                    <filters>
                        <filter>
                            <artifact>*:*</artifact>
                            <excludes>
                                <exclude>module-info.java</exclude>
                            </excludes>
                        </filter>
                    </filters>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.moditect</groupId>
                <artifactId>moditect-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>add-module-infos</id>
                        <phase>package</phase>
                        <goals>
                            <goal>add-module-info</goal>
                        </goals>
                        <configuration>
                            <overwriteExistingFiles>true</overwriteExistingFiles>
                            <module>
                                <moduleInfoFile>src/moditect/module-info.java</moduleInfoFile>
                            </module>
                        </configuration>
                    </execution>
                </executions>
            </plugin>


        </plugins>
    </build>

</project>
