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

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

    <parent>
        <groupId>com.sun.xml.ws</groupId>
        <artifactId>project</artifactId>
        <version>2.3.2</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.2</version>

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

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

    <dependencies>
        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>org.eclipse.persistence.sdo</artifactId>
            <version>${eclipselink.version}</version>
        </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-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>process-sources</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/lib</outputDirectory>
                            <excludeArtifactIds>javax.activation</excludeArtifactIds>
                            <stripVersion>true</stripVersion>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <!--TODO tests are skipped due to
                        Modules commonj.sdo and org.eclipse.persistence.sdo export package commonj.sdo.impl to module ha.api
                        remove after Eclipselink split package resolution.
                    -->
                    <skip>true</skip>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>osgi-bundle</id>
            <activation>
                <property>
                    <name>!cobertura-build</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>enforce-property</id>
                                <goals>
                                    <goal>enforce</goal>
                                </goals>
                                <phase>validate</phase>
                                <configuration>
                                    <rules>
                                        <requireProperty>
                                            <property>jaxb-api.osgiVersion</property>
                                            <message>Property jaxb-api.osgiVersion not imported or set!</message>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>jaxws.osgiVersion</property>
                                            <message>Property jaxws.osgiVersion not imported or set!</message>
                                        </requireProperty>
                                    </rules>
                                    <fail>true</fail>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <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>
                                        <Export-Package>
                                            com.sun.xml.ws.db.sdo;version=${jaxws.osgiVersion}
                                        </Export-Package>
                                        <Import-Package>
                                            com.sun.xml.ws.api.model;version=${jaxws.osgiVersion},
                                            com.sun.xml.ws.spi.db;version=${jaxws.osgiVersion},
                                            com.sun.xml.ws.util.xml;version=${jaxws.osgiVersion},
                                            commonj.sdo;version=2.1.1,
                                            commonj.sdo.helper;version=2.1.1,
                                            commonj.sdo.impl;version=2.1.1,
                                            javax.activation,
                                            javax.xml.bind;version=${jaxb-api.osgiVersion},
                                            javax.xml.bind.attachment;version=${jaxb-api.osgiVersion},
                                            javax.xml.namespace,
                                            javax.xml.parsers,
                                            javax.xml.stream,
                                            javax.xml.transform,
                                            javax.xml.transform.dom,
                                            javax.xml.transform.sax,
                                            javax.xml.transform.stax,
                                            javax.xml.transform.stream,
                                            org.eclipse.persistence;version=2.4.0,
                                            org.eclipse.persistence.oxm.attachment;version=2.4.0,
                                            org.eclipse.persistence.oxm.record;version=2.4.0,
                                            org.eclipse.persistence.sdo;version=2.4.0,
                                            org.eclipse.persistence.sdo.helper;version=2.4.0,
                                            org.w3c.dom,
                                            org.xml.sax,
                                            org.xml.sax.helpers
                                        </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>
