<?xml version="1.0" encoding="UTF-8"?>
<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.smallrye.reactive</groupId>
        <artifactId>vertx-mutiny-clients</artifactId>
        <version>3.20.4</version>
    </parent>

    <artifactId>smallrye-mutiny-vertx-core</artifactId>

    <name>SmallRye Mutiny - Vert.x Core</name>

    <properties>
        <gen-source-groupId>io.vertx</gen-source-groupId>
        <gen-source-artifactId>vertx-core</gen-source-artifactId>
        <gen-source-version>${vertx.version}</gen-source-version>
        <gen.output>${project.build.directory}/sources/java</gen.output>
    </properties>

    <dependencies>
        <dependency>
            <groupId>io.smallrye.reactive</groupId>
            <artifactId>mutiny</artifactId>
        </dependency>
        <dependency>
            <groupId>io.smallrye.reactive</groupId>
            <artifactId>smallrye-mutiny-vertx-runtime</artifactId>
            <version>${project.version}</version>
        </dependency>
        <!-- Generation source -->
        <dependency>
            <groupId>${gen-source-groupId}</groupId>
            <artifactId>${gen-source-artifactId}</artifactId>
            <version>${gen-source-version}</version>
            <exclusions>
                <exclusion>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>


        <!-- Extra dependencies -->
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>vertx-mutiny-generator</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${jackson.version}</version>
            <optional>true</optional>
        </dependency>

        <!-- Test dependencies -->
        <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-core</artifactId>
            <type>test-jar</type>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.dataformat</groupId>
            <artifactId>jackson-dataformat-yaml</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <configuration>
                    <includeGroupIds>${gen-source-groupId}</includeGroupIds>
                    <includeArtifactIds>${gen-source-artifactId}</includeArtifactIds>
                    <classifier>sources</classifier>
                    <includeTypes>jar</includeTypes>
                </configuration>
                <executions>
                    <!-- Unpack java sources to target/java-sources -->
                    <execution>
                        <id>unpack-java</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>unpack-dependencies</goal>
                        </goals>
                        <configuration>
                            <includes>io/vertx/**/*.java</includes>
                            <excludes>**/impl/**/*.java,io/vertx/core/logging/Log4jLogDelegate.java</excludes>
                            <outputDirectory>${gen.output}</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Automatic-Module-Name>io.smallrye.mutiny.vertx.core</Automatic-Module-Name>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.bsc.maven</groupId>
                <artifactId>maven-processor-plugin</artifactId>
                <version>5.1-jdk8</version>
                <configuration>
                    <systemProperties>
                        <java.util.logging.SimpleFormatter.format>%4$s: %3$s - %5$s %6$s%n
                        </java.util.logging.SimpleFormatter.format>
                        <mvel2.disable.jit>true</mvel2.disable.jit>
                    </systemProperties>
                </configuration>
                <executions>
                    <!-- Run the annotation processor on java sources and generate the API -->
                    <execution>
                        <id>generate-api</id>
                        <goals>
                            <goal>process</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <sourceDirectory>${project.build.directory}/sources/java</sourceDirectory>
                            <processors>
                                <processor>io.vertx.codegen.CodeGenProcessor</processor>
                            </processors>
                            <optionMap>
                                <codegen.generators>mutiny</codegen.generators>
                            </optionMap>
                        </configuration>
                    </execution>

                    <execution>
                        <id>generate-test-sources</id>
                        <goals>
                            <goal>process-test</goal>
                        </goals>
                        <phase>generate-test-sources</phase>
                        <configuration>
                            <processors>
                                <processor>io.vertx.codegen.CodeGenProcessor</processor>
                            </processors>
                            <optionMap>
                                <codegen.output>${project.basedir}/src/test</codegen.output>
                            </optionMap>
                            <defaultOutputDirectory>${project.build.directory}/generated-test-sources/test-annotations
                            </defaultOutputDirectory>
                        </configuration>
                    </execution>
                </executions>

                <!-- Log dependencies required by Vert.x -->
                <dependencies>
                    <dependency>
                        <groupId>org.apache.logging.log4j</groupId>
                        <artifactId>log4j-api</artifactId>
                        <version>2.25.2</version>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.logging.log4j</groupId>
                        <artifactId>log4j-core</artifactId>
                        <version>2.25.2</version>
                    </dependency>
                    <dependency>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-api</artifactId>
                        <version>2.0.0</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>


  <scm>
    <tag>3.20.4</tag>
  </scm>
</project>