<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ JBoss, Home of Professional Open Source.
  ~ Copyright 2020 Red Hat, Inc., and individual contributors
  ~ as indicated by the @author tags.
  ~
  ~ 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
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ 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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>io.undertow</groupId>
        <artifactId>undertow-parent</artifactId>
        <version>2.2.12.Final</version>
    </parent>

    <groupId>io.undertow</groupId>
    <artifactId>undertow-jakartaee9</artifactId>
    <version>2.2.12.Final</version>

    <name>Undertow Jakarta EE9</name>

    <properties>
        <version.jakarta.servlet-api>5.0.0</version.jakarta.servlet-api>
        <version.jakarta.websocket-client-api>2.0.0</version.jakarta.websocket-client-api>
    </properties>

    <dependencies>

        <dependency>
            <groupId>org.jboss.logging</groupId>
            <artifactId>jboss-logging</artifactId>
        </dependency>

        <dependency>
            <groupId>org.jboss.logging</groupId>
            <artifactId>jboss-logging-processor</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>io.undertow</groupId>
            <artifactId>undertow-examples</artifactId>
        </dependency>

        <dependency>
            <groupId>io.undertow</groupId>
            <artifactId>undertow-servlet</artifactId>
        </dependency>

        <dependency>
            <groupId>io.undertow</groupId>
            <artifactId>undertow-websockets-jsr</artifactId>
        </dependency>

        <dependency>
            <groupId>org.wildfly.extras.batavia</groupId>
            <artifactId>transformer-api</artifactId>
        </dependency>

        <dependency>
            <groupId>org.wildfly.extras.batavia</groupId>
            <artifactId>transformer-impl-eclipse</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.maven.shared</groupId>
            <artifactId>maven-invoker</artifactId>
            <version>3.0.1</version>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>${project.basedir}/src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <!-- pom files -->
                                <artifactItem>
                                    <groupId>io.undertow</groupId>
                                    <artifactId>undertow-servlet</artifactId>
                                    <version>${project.version}</version>
                                    <type>pom</type>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>${project.basedir}/target/input</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>io.undertow</groupId>
                                    <artifactId>undertow-examples</artifactId>
                                    <version>${project.version}</version>
                                    <type>pom</type>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>${project.basedir}/target/input</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>io.undertow</groupId>
                                    <artifactId>undertow-websockets-jsr</artifactId>
                                    <version>${project.version}</version>
                                    <type>pom</type>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>${project.basedir}/target/input</outputDirectory>
                                </artifactItem>
                                <!-- jar files -->
                                <artifactItem>
                                    <groupId>io.undertow</groupId>
                                    <artifactId>undertow-servlet</artifactId>
                                    <version>${project.version}</version>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>${project.basedir}/target/input</outputDirectory>
                                </artifactItem>
                               <artifactItem>
                                    <groupId>io.undertow</groupId>
                                    <artifactId>undertow-examples</artifactId>
                                    <version>${project.version}</version>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>${project.basedir}/target/input</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>io.undertow</groupId>
                                    <artifactId>undertow-websockets-jsr</artifactId>
                                    <version>${project.version}</version>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>${project.basedir}/target/input</outputDirectory>
                                </artifactItem>
                                <!-- source files -->
                                <artifactItem>
                                    <groupId>io.undertow</groupId>
                                    <artifactId>undertow-servlet</artifactId>
                                    <version>${project.version}</version>
                                    <overWrite>true</overWrite>
                                    <classifier>sources</classifier>
                                    <outputDirectory>${project.basedir}/target/output</outputDirectory>
                                    <destFileName>undertow-servlet-jakartaee9-${project.version}-sources.jar</destFileName>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>io.undertow</groupId>
                                    <artifactId>undertow-examples</artifactId>
                                    <version>${project.version}</version>
                                    <overWrite>true</overWrite>
                                    <classifier>sources</classifier>
                                    <outputDirectory>${project.basedir}/target/output</outputDirectory>
                                    <destFileName>undertow-examples-jakartaee9-${project.version}-sources.jar</destFileName>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>io.undertow</groupId>
                                    <artifactId>undertow-websockets-jsr</artifactId>
                                    <version>${project.version}</version>
                                    <overWrite>true</overWrite>
                                    <classifier>sources</classifier>
                                    <outputDirectory>${project.basedir}/target/output</outputDirectory>
                                    <destFileName>undertow-websockets-jsr-jakartaee9-${project.version}-sources.jar</destFileName>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>3.0.0</version>
                <executions>
                    <execution>
                        <id>transform-artifacts</id>
                        <phase>package</phase>
                        <goals>
                            <goal>java</goal>
                        </goals>
                        <configuration>
                            <mainClass>io.undertow.jakartaee9.JakartaEE9Transformer</mainClass>
                        </configuration>
                    </execution>
                    <execution>
                        <id>install-artifacts</id>
                        <phase>install</phase>
                        <goals>
                            <goal>java</goal>
                        </goals>
                        <configuration>
                            <mainClass>io.undertow.jakartaee9.JakartaEE9Installer</mainClass>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <systemProperties>
                        <systemProperty>
                            <key>version.jakarta.servlet-api</key>
                            <value>${version.jakarta.servlet-api}</value>
                        </systemProperty>
                        <systemProperty>
                            <key>version.jakarta.websocket-client-api</key>
                            <value>${version.jakarta.websocket-client-api}</value>
                        </systemProperty>
                    </systemProperties>
                </configuration>
            </plugin>
            <!-- <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>3.0.0-M1</version>
                <executions>
                    <execution>
                        <id>run</id>
                        <phase>deploy</phase>
                        <goals>
                            <goal>deploy-file</goal>
                        </goals>
                        <configuration>
                            <file>${project.basedir}/target/output/undertow-examples-jakartaee9-${project.version}.jar</file>
                            <pomFile>${project.basedir}/target/output/undertow-examples-jakartaee9-${project.version}.pom</pomFile>
                            <sources>${project.basedir}/target/output/undertow-examples-jakartaee9-${project.version}-sources.jar</sources>
                            <repositoryId>jboss-releases-repository</repositoryId>
                            <url>https://repository.jboss.org/nexus/service/local/staging/deploy/maven2</url>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                </configuration>
            </plugin> -->
        </plugins>
    </build>


</project>
