<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.jboss</groupId>
        <artifactId>jboss-parent</artifactId>
        <version>39</version>
        <relativePath />
    </parent>
    <groupId>org.iris-events</groupId>
    <artifactId>iris-parent</artifactId>
    <version>5.0.3</version>
    <packaging>pom</packaging>
    <name>Iris Parent</name>
    <modules>
        <module>common</module>
        <module>extension</module>
        <module>maven</module>
        <module>asyncapi</module>
    </modules>
    <scm>
        <connection>scm:git:git@github.com:iris-events/iris.git</connection>
        <developerConnection>scm:git:git@github.com:iris-events/iris.git</developerConnection>
        <tag>v5.0.3</tag>
        <url>https://github.com/iris-events/iris</url>
    </scm>
    <!--
    sort poms
    mvn com.github.ekryd.sortpom:sortpom-maven-plugin:3.1.0:sort "-Dsort.sortProperties=true" "-Dsort.nrOfIndentSpace=4" "-Dsort.keepBlankLines=true" "-Dsort.sortDependencies=scope,groupId,artifactId"

    -->
    <properties>
        <version.aether-api>1.1.0</version.aether-api>
        <version.apicurio-data-models>1.1.27</version.apicurio-data-models>
        <version.apicurio-registry-client>2.4.4.Final</version.apicurio-registry-client>
        <version.commons-logging>1.13.0</version.commons-logging>
        <version.hamcrest>2.2</version.hamcrest>
        <version.httpclient>4.5.14</version.httpclient>
        <version.jackson>2.15.2</version.jackson>
        <version.jakarta.annotations>2.1.1</version.jakarta.annotations>
        <version.jandex>3.1.2</version.jandex>
        <version.jsonschema2pojo-core>1.2.1</version.jsonschema2pojo-core>
        <version.junit>5.10.0</version.junit>
        <version.maven>3.9.4</version.maven>
        <version.maven-compat>3.8.1</version.maven-compat>
        <version.maven-plugin-annotations>3.9.0</version.maven-plugin-annotations>
        <version.maven-plugin-testing-harness>3.3.0</version.maven-plugin-testing-harness>
        <version.maven-project>2.2.1</version.maven-project>
        <version.maven-resolver-api>1.9.14</version.maven-resolver-api>
        <version.maven-surefire-plugin>3.0.0</version.maven-surefire-plugin>
        <version.plugin.plugin>3.8.2</version.plugin.plugin>
        <version.microprofile-config-api>3.0.3</version.microprofile-config-api>
        <version.mockito-core>5.5.0</version.mockito-core>
        <version.org.skyscreamer>1.5.1</version.org.skyscreamer>
        <!-- plugin dependencies -->

        <version.quarkus>3.2.4.Final</version.quarkus>
        <version.rabbit.amqp-client>5.16.1</version.rabbit.amqp-client>
        <version.resilience4j-retry>2.1.0</version.resilience4j-retry>
        <version.slf4j-api>2.0.7</version.slf4j-api>
        <version.victools>4.31.1</version.victools>
        <maven.compiler.target>17</maven.compiler.target>
        <maven.compiler.source>17</maven.compiler.source>
        <version.impsort.plugin>1.9.0</version.impsort.plugin>
        <version.formatter-maven-plugin>2.23.0</version.formatter-maven-plugin>
        <version.release.plugin>3.0.1</version.release.plugin>
    </properties>

    <dependencyManagement>
        <dependencies>

            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>${version.junit}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-annotations</artifactId>
                <version>${version.jackson}</version>
            </dependency>

            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${version.jackson}</version>
            </dependency>

            <dependency>
                <groupId>com.fasterxml.jackson.dataformat</groupId>
                <artifactId>jackson-dataformat-yaml</artifactId>
                <version>${version.jackson}</version>
            </dependency>

            <dependency>
                <groupId>jakarta.annotation</groupId>
                <artifactId>jakarta.annotation-api</artifactId>
                <version>${version.jakarta.annotations}</version>
            </dependency>

            <dependency>
                <groupId>org.iris-events</groupId>
                <artifactId>iris-asyncapi</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>org.iris-events</groupId>
                <artifactId>iris-asyncapi-spec-api</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>org.iris-events</groupId>
                <artifactId>iris-common</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.iris-events</groupId>
                <artifactId>iris-test</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.github.resilience4j</groupId>
                <artifactId>resilience4j-retry</artifactId>
                <version>${version.resilience4j-retry}</version>
            </dependency>
            <dependency>
                <groupId>io.quarkus</groupId>
                <artifactId>quarkus-smallrye-reactive-messaging-rabbitmq</artifactId>
                <version>${version.quarkus}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpclient</artifactId>
                <version>${version.httpclient}</version>
            </dependency>
            <!-- Apicurio Data Models -->
            <dependency>
                <groupId>io.apicurio</groupId>
                <artifactId>apicurio-data-models</artifactId>
                <version>${version.apicurio-data-models}</version>
            </dependency>

            <dependency>
                <groupId>io.apicurio</groupId>
                <artifactId>apicurio-registry-client</artifactId>
                <version>${version.apicurio-registry-client}</version>
            </dependency>

            <!-- Dependencies provided by the project -->
            <dependency>
                <groupId>org.eclipse.microprofile.config</groupId>
                <artifactId>microprofile-config-api</artifactId>
                <version>${version.microprofile-config-api}</version>
            </dependency>

            <dependency>
                <groupId>io.smallrye</groupId>
                <artifactId>jandex</artifactId>
                <version>${version.jandex}</version>
            </dependency>

            <dependency>
                <groupId>org.jsonschema2pojo</groupId>
                <artifactId>jsonschema2pojo-core</artifactId>
                <version>${version.jsonschema2pojo-core}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${version.slf4j-api}</version>
            </dependency>
            <dependency>
                <groupId>com.rabbitmq</groupId>
                <artifactId>amqp-client</artifactId>
                <version>${version.rabbit.amqp-client}</version>
            </dependency>

            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest</artifactId>
                <version>${version.hamcrest}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.jboss.logmanager</groupId>
                <artifactId>jboss-logmanager</artifactId>
                <version>3.0.0.Final</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${version.mockito-core}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.skyscreamer</groupId>
                <artifactId>jsonassert</artifactId>
                <version>${version.org.skyscreamer}</version>
                <scope>test</scope>
            </dependency>

        </dependencies>
    </dependencyManagement>
    <build>
        <plugins>
            <plugin>
                <groupId>net.revelc.code.formatter</groupId>
                <artifactId>formatter-maven-plugin</artifactId>
                <version>${version.formatter-maven-plugin}</version>
                <dependencies>
                    <dependency>
                        <artifactId>quarkus-ide-config</artifactId>
                        <groupId>io.quarkus</groupId>
                        <version>${version.quarkus}</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <!-- store outside of target to speed up formatting when mvn clean is used -->
                    <cachedir>.cache/formatter-maven-plugin-${formatter-maven-plugin.version}</cachedir>
                    <configFile>eclipse-format.xml</configFile>
                    <skip>${format.skip}</skip>
                </configuration>
            </plugin>
            <plugin>
                <groupId>net.revelc.code</groupId>
                <artifactId>impsort-maven-plugin</artifactId>
                <version>${version.impsort.plugin}</version>
                <configuration>
                    <!-- store outside of target to speed up formatting when mvn clean is used -->
                    <cachedir>.cache/impsort-maven-plugin-${impsort-maven-plugin.version}</cachedir>
                    <groups>java.,javax.,jakarta.,org.,com.</groups>
                    <staticGroups>*</staticGroups>
                    <skip>${format.skip}</skip>
                    <removeUnused>true</removeUnused>
                    <compliance>17</compliance>
                </configuration>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <configuration>
                        <arguments>-Prelease</arguments>
                        <tagNameFormat>v@{project.version}</tagNameFormat>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>
    <profiles>
    <profile>
        <id>format</id>
        <activation>
            <activeByDefault>true</activeByDefault>
            <property>
                <name>!no-format</name>
            </property>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>net.revelc.code.formatter</groupId>
                    <artifactId>formatter-maven-plugin</artifactId>
                    <executions>
                        <execution>
                            <phase>process-sources</phase>
                            <goals>
                                <goal>format</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>net.revelc.code</groupId>
                    <artifactId>impsort-maven-plugin</artifactId>
                    <configuration>
                        <removeUnused>true</removeUnused>
                    </configuration>
                    <executions>
                        <execution>
                            <id>sort-imports</id>
                            <goals>
                                <goal>sort</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>
    <profile>
        <id>validate</id>
        <activation>
            <activeByDefault>true</activeByDefault>
            <property>
                <name>no-format</name>
            </property>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>net.revelc.code.formatter</groupId>
                    <artifactId>formatter-maven-plugin</artifactId>
                    <executions>
                        <execution>
                            <phase>process-sources</phase>
                            <goals>
                                <goal>validate</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>net.revelc.code</groupId>
                    <artifactId>impsort-maven-plugin</artifactId>
                    <configuration>
                        <removeUnused>true</removeUnused>
                    </configuration>
                    <executions>
                        <execution>
                            <id>check-imports</id>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>

    <profile>
        <id>release</id>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>1.6.13</version>
                    <extensions>true</extensions>
                    <configuration>
                        <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                        <serverId>ossrh</serverId>
                        <autoReleaseAfterClose>true</autoReleaseAfterClose>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>attach-sources</id>
                            <goals>
                                <goal>jar-no-fork</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <!--
                    ## IMPORTANT ##
                    In your ~/.m2/settings.xml you need to add and edit the following profile:
                    <profile>
                        <id>release</id>
                        <properties>
                            <gpg.useagent>false</gpg.useagent>
                            <gpg.executable>/usr/local/Cellar/gnupg@1.4/1.4.23_1/bin/gpg1</gpg.executable> <- use gpg1 on Mac OS X <gpg.homedir>~/.gnupg</gpg.homedir>  <- Update to your own directory <gpg.passphrase>******</gpg.passphrase> <- Add your passphrase </properties>
                    </profile>
                     -->
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>sign-artifacts</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>
    </profiles>
</project>
