<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">
    <parent>
        <groupId>org.jboss</groupId>
        <artifactId>jboss-parent</artifactId>
        <version>51</version>
        <relativePath />
    </parent>

    <modelVersion>4.0.0</modelVersion>

    <groupId>dev.resteasy.grpc</groupId>
    <artifactId>resteasy-grpc-parent</artifactId>
    <version>1.0.0.Final</version>
    <packaging>pom</packaging>

    <name>resteasy-grpc parent</name>
    <description>Scans a Jakarta REST application and generates a runtime that allows
        a gRPC runtime to communicate with the Jakarta REST resources</description>
    <url>https://resteasy.dev</url>

    <licenses>
        <license>
            <name>Apache License 2.0</name>
            <url>https://repository.jboss.org/licenses/apache-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git://github.com/resteasy/resteasy-grpc.git</connection>
        <developerConnection>scm:git:git@github.com:resteasy/resteasy-grpc.git</developerConnection>
        <url>https://github.com/resteasy/resteasy-grpc/tree/main/</url>
      <tag>v1.0.0.Final</tag>
  </scm>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/resteasy/resteasy-grpc/issues</url>
    </issueManagement>

    <developers>
        <developer>
            <id>ronsigal</id>
            <name>Ron Sigal</name>
            <email>rsigal@redhat.com</email>
            <organization>JBoss by Red Hat</organization>
            <url>https://resteasy.dev</url>
            <roles>
                <role>project-owner</role>
            </roles>
            <timezone>-5</timezone>
        </developer>
        <developer>
            <id>jamezp</id>
            <name>James Perkins</name>
            <email>jperkins@redhat.com</email>
            <organization>JBoss by Red Hat</organization>
            <url>https://resteasy.dev</url>
            <roles>
                <role>project-owner</role>
            </roles>
            <timezone>-8</timezone>
        </developer>
    </developers>

    <properties>
        <!-- maven release properties-->
        <nexus.repository.release>resteasy</nexus.repository.release>
        <nexus.repository.staging>resteasy-staging</nexus.repository.staging>
        <nexus.staging.tag>resteasy-grpc-${project.version}</nexus.staging.tag>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.release>17</maven.compiler.release>
        <maven.compiler.source>${maven.compiler.release}</maven.compiler.source>
        <maven.compiler.target>${maven.compiler.release}</maven.compiler.target>
        <!-- Dependency versions, please keep in alphabetical order -->

        <version.jakarta.enterprise>4.0.1</version.jakarta.enterprise>
        <version.jakarta.servlet>5.0.0</version.jakarta.servlet>
        <version.jakarta.ws.rs>3.1.0</version.jakarta.ws.rs>

        <version.com.github.javaparser>3.27.1</version.com.github.javaparser>
        <version.com.google.protobuf>4.31.1</version.com.google.protobuf>
        <version.io.grpc>1.73.0</version.io.grpc>

        <version.io.undertow>2.3.20.Final</version.io.undertow>

        <version.org.jboss.logging.jboss-logging>3.6.1.Final</version.org.jboss.logging.jboss-logging>
        <version.org.jboss.logging.jboss-logging-tools>3.0.4.Final</version.org.jboss.logging.jboss-logging-tools>
        <version.org.jboss.logmanager.jboss-logmanager>3.1.2.Final</version.org.jboss.logmanager.jboss-logmanager>
        <version.org.jboss.slf4j.slf4j-jboss-logmanager>2.0.2.Final</version.org.jboss.slf4j.slf4j-jboss-logmanager>
        <version.org.jboss.resteasy>7.0.0.Final</version.org.jboss.resteasy>

        <version.org.wildfly>36.0.0.Final</version.org.wildfly>

        <!-- Test only dependencies -->
        <version.com.github.tomakehurst.wiremock>2.27.2</version.com.github.tomakehurst.wiremock>

        <!-- Plugin Versions -->
        <version.formatter.maven.plugin>2.29.0</version.formatter.maven.plugin>
        <version.impsort.maven.plugin>1.12.0</version.impsort.maven.plugin>
        <version.central.publishing.maven.plugin>0.9.0</version.central.publishing.maven.plugin>
        <version.org.wildfly.wildfly-maven-plugin>5.1.5.Final</version.org.wildfly.wildfly-maven-plugin>
        <version.os-maven-plugin>1.7.1</version.os-maven-plugin>
        <version.protobuf-maven-plugin>0.6.1</version.protobuf-maven-plugin>

        <!-- Plugin Versions, please keep in alphabetical order -->
        <!-- print logs to file by default -->
        <maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
        <!-- maven-enforcer-plugin -->
        <maven.min.version>3.6.0</maven.min.version>
        <!-- maven-surefire-plugin -->
        <surefire.system.args>-Xms512m -Xmx512m</surefire.system.args>

        <maven.test.skip>false</maven.test.skip>
        <skipTests>${maven.test.skip}</skipTests>
        <skip.format>false</skip.format>
        <skip.compile>false</skip.compile>

        <!-- maven-release-plugin configuration -->
        <autoVersionSubmodules>true</autoVersionSubmodules>
        <releaseProfiles>release</releaseProfiles>
        <signTag>true</signTag>
        <tagNameFormat>v@{project.version}</tagNameFormat>
        <arguments>-DskipTests</arguments>
        <!-- By default, push changes to the maven-release-plugin:prepare -->
        <pushChanges>true</pushChanges>
        <!-- Use the local directory when using perform -->
        <localCheckout>true</localCheckout>
        <!-- Maven Central properties -->
        <repo.sonatype.url>https://central.sonatype.com</repo.sonatype.url>
        <sonatype.server.id>central</sonatype.server.id>
        <autoPublish>true</autoPublish>
        <waitUntil>published</waitUntil>
    </properties>

    <modules>
        <module>grpc-bom</module>
        <module>grpc-test-bom</module>
        <module>grpc-bridge</module>
        <module>grpc-bridge-runtime</module>
        <module>testsuite</module>
    </modules>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.wildfly.plugins</groupId>
                    <artifactId>wildfly-maven-plugin</artifactId>
                    <version>${version.org.wildfly.wildfly-maven-plugin}</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <!-- Format source files -->
            <plugin>
                <groupId>net.revelc.code.formatter</groupId>
                <artifactId>formatter-maven-plugin</artifactId>
                <version>${version.formatter.maven.plugin}</version>
                <dependencies>
                    <dependency>
                        <groupId>dev.resteasy.tools</groupId>
                        <artifactId>ide-config</artifactId>
                        <version>3</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <!-- store outside of target to speed up formatting when mvn clean is used -->
                    <cachedir>.cache</cachedir>
                    <configFile>eclipse-code-formatter.xml</configFile>
                    <configXmlFile>resteasy-xml.properties</configXmlFile>
                    <includeResources>true</includeResources>
                    <lineEnding>LF</lineEnding>
                    <removeTrailingWhitespace>true</removeTrailingWhitespace>
                    <skip>${skipFormatting}</skip>
                </configuration>
                <executions>
                    <execution>
                        <id>format</id>
                        <goals>
                            <goal>format</goal>
                        </goals>
                        <phase>process-sources</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>net.revelc.code</groupId>
                <artifactId>impsort-maven-plugin</artifactId>
                <version>${version.impsort.maven.plugin}</version>
                <configuration>
                    <!-- store outside of target to speed up formatting when mvn clean is used -->
                    <cachedir>.cache</cachedir>
                    <groups>java.,javax.,jakarta.,org.,com.</groups>
                    <staticGroups>*</staticGroups>
                    <skip>${skipFormatting}</skip>
                    <removeUnused>true</removeUnused>
                </configuration>
                <executions>
                    <execution>
                        <id>sort-imports</id>
                        <goals>
                            <goal>sort</goal>
                        </goals>
                        <phase>process-sources</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>format-check</id>
            <build>
                <plugins>
                    <!-- Validate formatting -->
                    <plugin>
                        <groupId>net.revelc.code.formatter</groupId>
                        <artifactId>formatter-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>validate-format</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>validate</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>net.revelc.code</groupId>
                        <artifactId>impsort-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>check-import-sort</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>check-import-sort-resources</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                                <configuration>
                                    <sourceDirectory>${project.basedir}/src/main/resources</sourceDirectory>
                                    <testSourceDirectory>${project.basedir}/src/test/resources</testSourceDirectory>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>release</id>
            <activation>
                <property>
                    <name>release</name>
                </property>
            </activation>

            <distributionManagement>
                <snapshotRepository>
                    <id>${sonatype.server.id}</id>
                    <url>${repo.sonatype.url}</url>
                </snapshotRepository>
                <repository>
                    <id>${sonatype.server.id}</id>
                    <url>${repo.sonatype.url}</url>
                </repository>
            </distributionManagement>

            <build>
                <plugins>
                    <!-- Semantically ordered -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <configuration>
                            <rules>
                                <requireReleaseDeps>
                                    <message>No Snapshots Allowed!</message>
                                </requireReleaseDeps>
                            </rules>
                        </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>
                        <configuration>
                            <additionalOptions>
                                <additionalOption>-html5</additionalOption>
                            </additionalOptions>
                            <detectLinks>true</detectLinks>
                            <doclint>none</doclint>
                            <failOnError>false</failOnError>
                            <show>public</show>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <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>
                                <configuration>
                                    <!-- Prevent gpg from using pinentry programs -->
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>${version.central.publishing.maven.plugin}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>${sonatype.server.id}</publishingServerId>
                            <autoPublish>${autoPublish}</autoPublish>
                            <waitUntil>${waitUntil}</waitUntil>
                            <deploymentName>resteasy-grpc-${project.version}</deploymentName>
                            <!-- Exclude tests from being deployed -->
                            <excludeArtifacts>
                                <excludeArtifact>testsuite</excludeArtifact>
                            </excludeArtifacts>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <repositories>
        <!-- Required for provisioning WildFly. Not all dependencies currently exist on Maven Central. This is also
             useful for when we want to test with versions releases that have not yet been synchronized to Maven Central
             from JBoss Nexus.
         -->
        <repository>
            <releases>
                <enabled>true</enabled>
                <updatePolicy>never</updatePolicy>
            </releases>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>never</updatePolicy>
            </snapshots>
            <id>jboss-public-repository-group</id>
            <name>JBoss Public Repository Group</name>
            <url>https://repository.jboss.org/nexus/content/groups/public/</url>
            <layout>default</layout>
        </repository>
    </repositories>
</project>
