<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2018-Present The CloudEvents Authors
  ~ <p>
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~ <p>
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~ <p>
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  ~
  -->
<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">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>io.cloudevents</groupId>
        <artifactId>cloudevents-parent</artifactId>
        <version>2.5.0</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>

    <artifactId>cloudevents-http-restful-ws-jakarta</artifactId>
    <name>CloudEvents - Jakarta EE 9+ - Jakarta RESTful Web Services Http Binding</name>
    <packaging>jar</packaging>

    <pluginRepositories>
        <pluginRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
            <layout>default</layout>
            <releases>
                <enabled>true</enabled>
            </releases>
        </pluginRepository>
    </pluginRepositories>

    <properties>
        <jakarta-ee.version>3.0.0</jakarta-ee.version>
        <jersey.version>3.0.8</jersey.version>
        <vertx.version>4.4.3</vertx.version>
        <resteasy.version>6.0.3.Final</resteasy.version>
        <module-name>io.cloudevents.http.restfulws</module-name>
    </properties>

    <dependencies>
        <dependency>
            <groupId>io.cloudevents</groupId>
            <artifactId>cloudevents-core</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>jakarta.ws.rs</groupId>
            <artifactId>jakarta.ws.rs-api</artifactId>
            <version>${jakarta-ee.version}</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>3.0.0</version>
                <executions>
                    <execution>
                        <phase>generate-sources
                        </phase>
                        <configuration>
                            <target>
                                <delete dir="src/main"/>
                                <copy todir="src">
                                    <fileset dir="../restful-ws\src" />
                                    <filterchain>
                                        <replaceregex pattern="javax." replace="jakarta." />
                                    </filterchain>
                                </copy>
                                <move todir="src/main/resources/META-INF/services">
                                    <fileset dir="src/main/resources/META-INF/services" />
                                    <mapper type="regexp" from="(.*)javax.(.*)" to="\1jakarta.\2"/>
                                </move>
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
