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

    Copyright (c) 1997, 2021 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/maven-v4_0_0.xsd">

    <parent>
        <groupId>com.sun.xml.ws</groupId>
        <artifactId>project</artifactId>
        <version>2.3.5</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <groupId>com.sun.xml.ws</groupId>
    <artifactId>sdo-eclipselink-plugin</artifactId>
    <version>2.3.5</version>

    <name>JAX-WS RI Eclipselink SDO Plugin</name>
    <description>Pluggable databinding module employing Eclipselink SDO</description>

    <properties>
        <spotbugs.exclude>${project.basedir}/exclude.xml</spotbugs.exclude>
        <argLine/>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>org.eclipse.persistence.sdo</artifactId>
        </dependency>
        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>commonj.sdo</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>jaxws-rt</artifactId>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <executions>
                    <execution>
                        <id>default-compile</id>
                        <configuration>
                            <!--adds reads for gmbal-->
                            <compilerArgs>
                                <arg>--add-reads</arg>
                                <arg>com.sun.xml.ws.sdo=ALL-UNNAMED</arg>
                            </compilerArgs>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <argLine>
                        --add-exports com.sun.xml.ws.sdo/com.sun.xml.ws.sdo.test=ALL-UNNAMED
                        --add-exports com.sun.xml.ws.sdo/com.sun.xml.ws.sdo.test.add=ALL-UNNAMED
                        --add-exports com.sun.xml.ws.sdo/com.sun.xml.ws.sdo.test.helloSDO=ALL-UNNAMED
                        --add-exports com.sun.xml.ws.sdo/com.sun.xml.ws.sdo.sample.service=ALL-UNNAMED
                        --add-exports com.sun.xml.ws.sdo/com.sun.xml.ws.sdo.sample.service=com.sun.xml.ws
                        --add-exports com.sun.xml.ws.sdo/com.sun.xml.ws.sdo.sample.service.types=ALL-UNNAMED
                        @{argLine}
                    </argLine>
                    <forkCount>1</forkCount>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <additionalJOptions>
                        <additionalJOption>--add-reads</additionalJOption>
                        <additionalJOption>com.sun.xml.ws.sdo=ALL-UNNAMED</additionalJOption>
                    </additionalJOptions>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>osgi-bundle</id>
            <activation>
                <property>
                    <name>!jacoco-build</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.felix</groupId>
                        <artifactId>maven-bundle-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>osgi-bundle</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>manifest</goal>
                                </goals>
                                <configuration>
                                    <instructions>
                                        <Bundle-ActivationPolicy>lazy</Bundle-ActivationPolicy>
                                        <Import-Package>
                                            javax.activation;version=!,
                                            commonj.sdo.*;version=!,
                                            org.eclipse.persistence.*;version=!,
                                            *
                                        </Import-Package>
                                    </instructions>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-jar-plugin</artifactId>
                        <configuration>
                            <archive>
                                <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                            </archive>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
