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

    Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved.

    This program and the accompanying materials are made available under the
    terms of the Eclipse Public License v. 2.0, which is available at
    http://www.eclipse.org/legal/epl-2.0.

    This Source Code may also be made available under the following Secondary
    Licenses when the conditions for such availability set forth in the
    Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
    version 2 with the GNU Classpath Exception, which is available at
    https://www.gnu.org/software/classpath/license.html.

    SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0

-->

<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">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.glassfish.tyrus.bundles</groupId>
        <artifactId>tyrus-bundles</artifactId>
        <version>2.0.0-M3</version>
    </parent>

    <artifactId>websocket-ri-bundle</artifactId>
    <name>Tyrus Websocket RI Bundle</name>
    <packaging>bundle</packaging>

    <dependencies>
        <dependency>
            <groupId>jakarta.servlet</groupId>
            <artifactId>jakarta.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.enterprise</groupId>
            <artifactId>jakarta.enterprise.cdi-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.ejb</groupId>
            <artifactId>jakarta.ejb-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.grizzly</groupId>
            <artifactId>grizzly-framework</artifactId>
            <version>${grizzly.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.grizzly</groupId>
            <artifactId>grizzly-http-server</artifactId>
            <version>${grizzly.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.tyrus</groupId>
            <artifactId>tyrus-container-glassfish-ejb</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.core</artifactId>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>${basedir}/target/src/main/resources</directory>
            </resource>
            <resource>
                <directory>${basedir}/src/main/resources</directory>
            </resource>
            <resource>
                <directory>${gen-src-dir}</directory>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
                <filtering>true</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${gen-src-dir}</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>unpack</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>jakarta.websocket</groupId>
                                    <artifactId>jakarta.websocket-api</artifactId>
                                    <classifier>sources</classifier>
                                    <overWrite>false</overWrite>
                                    <outputDirectory>${gen-src-dir}</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.glassfish.tyrus</groupId>
                                    <artifactId>tyrus-core</artifactId>
                                    <version>${project.version}</version>
                                    <classifier>sources</classifier>
                                    <overWrite>false</overWrite>
                                    <outputDirectory>${gen-src-dir}</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.glassfish.tyrus</groupId>
                                    <artifactId>tyrus-client</artifactId>
                                    <version>${project.version}</version>
                                    <classifier>sources</classifier>
                                    <overWrite>false</overWrite>
                                    <outputDirectory>${gen-src-dir}</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.glassfish.tyrus</groupId>
                                    <artifactId>tyrus-server</artifactId>
                                    <version>${project.version}</version>
                                    <classifier>sources</classifier>
                                    <overWrite>false</overWrite>
                                    <outputDirectory>${gen-src-dir}</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.glassfish.tyrus</groupId>
                                    <artifactId>tyrus-container-glassfish-cdi</artifactId>
                                    <version>${project.version}</version>
                                    <classifier>sources</classifier>
                                    <overWrite>false</overWrite>
                                    <outputDirectory>${gen-src-dir}</outputDirectory>
                                    <excludes>META-INF/services/org.glassfish.tyrus.core.ComponentProvider</excludes>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.glassfish.tyrus</groupId>
                                    <artifactId>tyrus-container-glassfish-ejb</artifactId>
                                    <version>${project.version}</version>
                                    <classifier>sources</classifier>
                                    <overWrite>false</overWrite>
                                    <outputDirectory>${gen-src-dir}</outputDirectory>
                                    <excludes>META-INF/services/org.glassfish.tyrus.core.ComponentProvider</excludes>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.glassfish.tyrus</groupId>
                                    <artifactId>tyrus-container-grizzly-client</artifactId>
                                    <version>${project.version}</version>
                                    <classifier>sources</classifier>
                                    <overWrite>false</overWrite>
                                    <outputDirectory>${gen-src-dir}</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.glassfish.tyrus</groupId>
                                    <artifactId>tyrus-container-grizzly-server</artifactId>
                                    <version>${project.version}</version>
                                    <classifier>sources</classifier>
                                    <overWrite>false</overWrite>
                                    <outputDirectory>${gen-src-dir}</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.glassfish.tyrus</groupId>
                                    <artifactId>tyrus-container-servlet</artifactId>
                                    <version>${project.version}</version>
                                    <classifier>sources</classifier>
                                    <overWrite>false</overWrite>
                                    <outputDirectory>${gen-src-dir}</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.glassfish.tyrus</groupId>
                                    <artifactId>tyrus-spi</artifactId>
                                    <version>${project.version}</version>
                                    <classifier>sources</classifier>
                                    <overWrite>false</overWrite>
                                    <outputDirectory>${gen-src-dir}</outputDirectory>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <configuration>
                    <instructions>
                        <Bundle-Name>${project.artifactId}</Bundle-Name>
                        <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
                        <Bundle-SpecVersion>${websocket-api.version}</Bundle-SpecVersion>
                        <Bundle-Version>${project.version}</Bundle-Version>
                        <Specification-Version>${websocket-api.version}</Specification-Version>
                        <Implementation-Version>
                            ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}
                        </Implementation-Version>
                        <Extension-Name>${project.artifactId}</Extension-Name>
                        <Export-Package>
                            jakarta.websocket.*;version=${websocket-api.version},
                            org.glassfish.tyrus.*;version=${project.version}
                        </Export-Package>
                        <Import-Package>
                            jakarta.servlet.*;version="${servlet.api.version}",
                            org.glassfish.grizzly.http.server.*;version=${grizzly.version}
                            org.glassfish.grizzly.*;version=${grizzly.version},
                            *
                        </Import-Package>
                    </instructions>
                    <unpackBundle>true</unpackBundle>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <failOnError>false</failOnError>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <properties>
        <gen-src-dir>${basedir}/target/src/main/java</gen-src-dir>
    </properties>

</project>
