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

    Copyright (c) 2018 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>
        <artifactId>jakarta.xml.bind-api-parent</artifactId>
        <groupId>jakarta.xml.bind</groupId>
        <version>2.3.2</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

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

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

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.xml.bind</groupId>
            <artifactId>jakarta.xml.bind-api</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>jakarta.activation</groupId>
            <artifactId>jakarta.activation-api</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <release>11</release>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>jakarta.xml.bind</groupId>
                                    <artifactId>jakarta.xml.bind-api</artifactId>
                                    <version>${project.version}</version>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>${project.build.directory}/modules</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>jakarta.activation</groupId>
                                    <artifactId>jakarta.activation-api</artifactId>
                                    <version>${activation.version}</version>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>${project.build.directory}/modules</outputDirectory>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/classes/META-INF</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>${legal.doc.source}</directory>
                                    <includes>
                                        <include>LICENSE.md</include>
                                        <include>NOTICE.md</include>
                                    </includes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <!--module-path ${project.build.directory}/modules/jakarta.activation-api-${activation.version}.jar -->
                    <argLine>
                        --add-modules java.xml.bind
                        --upgrade-module-path ${project.build.directory}/modules/jakarta.xml.bind-api-${project.version}.jar
                        --module-path ${project.build.directory}/modules/jakarta.activation-api-${activation.version}.jar
                        --add-reads java.xml.bind=ALL-UNNAMED
                    </argLine>
                    <systemPropertyVariables>
                        <java.util.logging.config.file>
                            src/test/resources/logging.properties
                        </java.util.logging.config.file>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <doclint>none</doclint>
                    <nodeprecated>false</nodeprecated>
                    <use>false</use>
                    <author>true</author>
                    <version>true</version>
                    <doctitle><![CDATA[<br>
JAXB ${project.version} API Library Tests</h2>
${project.name} specification, ${release.spec.date}<br>
Comments to: <i><a href='mailto:${release.spec.feedback}'>${release.spec.feedback}</a></i><br>
More information at: <i><a target='_top'
href='https://projects.eclipse.org/projects/ee4j.jaxb'>https://projects.eclipse.org/projects/ee4j.jaxb</a></i><br>
&nbsp;<br>&nbsp;<br><hr width='65%'><h1>${project.name}</h1><hr width='75%'>
<br>&nbsp;<br>]]>
                    </doctitle>
                    <header><![CDATA[JAXB<br>v${project.version}]]>
                    </header>
                    <bottom>
                        <![CDATA[<br>Copyright &#169; {inceptionYear}&#x2013;{currentYear} Oracle and/or its affiliates.
                        All rights reserved.<br>Comments to : <a href="mailto:${release.spec.feedback}">${release.spec.feedback}</a>.]]>
                    </bottom>
                    <detectJavaApiLink>false</detectJavaApiLink>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>
