<?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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>io.serverlessworkflow</groupId>
    <artifactId>serverlessworkflow-parent</artifactId>
    <version>7.0.0.Final</version>
    <packaging>pom</packaging>

    <name>Serverless Workflow :: Parent</name>
    <url>https://serverlessworkflow.io/sdk-java/</url>
    <description>Java SDK for Serverless Workflow Specification</description>
    <inceptionYear>2020</inceptionYear>
    <developers>
        <developer>
            <id>serverless-workflow</id>
            <name>Serverless Workflow Specification Authors</name>
            <organization>CNCF</organization>
        </developer>
    </developers>
    <organization>
        <name>CNCF</name>
        <url>https://www.cncf.io//</url>
    </organization>
    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <scm>
        <connection>scm:git:git@github.com:serverlessworkflow/sdk-java.git</connection>
        <developerConnection>scm:git:git@github.com:serverlessworkflow/sdk-java.git</developerConnection>
        <url>https://github.com/serverlessworkflow/sdk-java</url>
        <tag>7.0.0.Final</tag>
    </scm>

  <modules>
    <module>api</module>
    <module>custom-generator</module>
    <module>impl</module>
  </modules>

    <properties>
        <java.version>17</java.version>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <version.maven>3.9.7</version.maven>

        <!-- Plugin versions, please keep in alphabetical order -->
        <version.buildnumber.plugin>3.2.1</version.buildnumber.plugin>
        <version.checkstyle.plugin>3.6.0</version.checkstyle.plugin>
        <version.compiler.plugin>3.13.0</version.compiler.plugin>
        <version.deploy.plugin>3.1.3</version.deploy.plugin>
        <version.enforcer.plugin>3.5.0</version.enforcer.plugin>
        <version.failsafe.plugin>3.5.2</version.failsafe.plugin>
        <version.fmt-maven-plugin>2.25</version.fmt-maven-plugin>
        <version.gpg.plugin>3.2.7</version.gpg.plugin>
        <version.jar.plugin>3.4.2</version.jar.plugin>
        <version.jdk>${java.version}</version.jdk>
        <version.jsonschema2pojo-maven-plugin>1.2.2</version.jsonschema2pojo-maven-plugin>
        <version.javadoc.plugin>3.11.2</version.javadoc.plugin>
        <version.release.plugin>3.1.1</version.release.plugin>
        <version.source.plugin>3.3.1</version.source.plugin>
        <version.surefire.plugin>3.5.2</version.surefire.plugin>
        <version.nexus.plugin>1.6.13</version.nexus.plugin>


        <!-- Dependencies versions, please keep in alphabetical order -->
        <version.ch.qos.logback>1.5.16</version.ch.qos.logback>
        <version.com.fasterxml.jackson>2.18.2</version.com.fasterxml.jackson>
        <version.com.networknt>1.5.5</version.com.networknt>
        <version.jakarta.validation>3.1.1</version.jakarta.validation>
        <version.jsonassert>1.5.2</version.jsonassert>
        <version.org.assertj>3.27.3</version.org.assertj>
        <version.org.junit.jupiter>5.11.4</version.org.junit.jupiter>
        <version.org.mockito>5.15.2</version.org.mockito>
        <version.org.slf4j>2.0.16</version.org.slf4j>
        <version.org.hibernate.validator>8.0.2.Final</version.org.hibernate.validator>
        <version.org.glassfish.expressly>5.0.0</version.org.glassfish.expressly>

        <!-- Checkstyle props -->
        <checkstyle.failOnViolation>true</checkstyle.failOnViolation>
        <checkstyle.header.template><![CDATA[
^\/\*$\n^
\* Copyright \d\d\d\d-Present The Serverless Workflow Specification Authors$\n^
\*$\n^
\* Licensed under the Apache License, Version 2\.0 \(the &quot;License&quot;\);$\n^
\* you may not use this file except in compliance with the License\.$\n^
\* You may obtain a copy of the License at$\n^
\*$\n^
\* http:\/\/www\.apache\.org\/licenses\/LICENSE-2\.0$\n^
\*$\n^
\* Unless required by applicable law or agreed to in writing, software$\n^
\* distributed under the License is distributed on an &quot;AS IS&quot; BASIS,$\n^
\* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.$\n^
\* See the License for the specific language governing permissions and$\n^
\* limitations under the License\.$\n^
\*\/$
]]>
        </checkstyle.header.template>
        <checkstyle.header.extensions>java</checkstyle.header.extensions>
        <checkstyle.logViolationsToConsole>true</checkstyle.logViolationsToConsole>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${version.org.slf4j}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-core</artifactId>
                <version>${version.com.fasterxml.jackson}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${version.com.fasterxml.jackson}</version>
            </dependency>
            <dependency>
                <groupId>com.networknt</groupId>
                <artifactId>json-schema-validator</artifactId>
                <version>${version.com.networknt}</version>
            </dependency>
            <dependency>
                <groupId>org.hibernate.validator</groupId>
                <artifactId>hibernate-validator</artifactId>
                <version>${version.org.hibernate.validator}</version>
            </dependency>
            <dependency>
                <groupId>org.glassfish.expressly</groupId>
                <artifactId>expressly</artifactId>
                <version>${version.org.glassfish.expressly}</version>
            </dependency>

            <dependency>
                <groupId>com.fasterxml.jackson.dataformat</groupId>
                <artifactId>jackson-dataformat-yaml</artifactId>
                <version>${version.com.fasterxml.jackson}</version>
            </dependency>
            <dependency>
                <groupId>org.jsonschema2pojo</groupId>
                <artifactId>jsonschema2pojo-core</artifactId>
                <version>${version.jsonschema2pojo-maven-plugin}</version>
            </dependency>
            <dependency>
                <groupId>jakarta.validation</groupId>
                <artifactId>jakarta.validation-api</artifactId>
                <version>${version.jakarta.validation}</version>
            </dependency>

            <!-- test -->
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-api</artifactId>
                <version>${version.org.junit.jupiter}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-engine</artifactId>
                <version>${version.org.junit.jupiter}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-params</artifactId>
                <version>${version.org.junit.jupiter}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${version.org.mockito}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>${version.ch.qos.logback}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>${version.org.assertj}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <!-- Set properties containing the scm revision -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>buildnumber-maven-plugin</artifactId>
                <version>${version.buildnumber.plugin}</version>
                <executions>
                    <execution>
                        <id>get-scm-revision</id>
                        <phase>initialize</phase>
                        <goals>
                            <goal>create</goal>
                        </goals>
                        <configuration>
                            <doCheck>false</doCheck>
                            <doUpdate>false</doUpdate>
                            <revisionOnScmFailure>UNKNOWN</revisionOnScmFailure>
                            <getRevisionOnlyOnce>true</getRevisionOnlyOnce>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${version.compiler.plugin}</version>
                <configuration>
                    <showDeprecation>true</showDeprecation>
                    <showWarnings>true</showWarnings>
                    <source>${maven.compiler.source}</source>
                    <target>${maven.compiler.target}</target>
                    <testSource>${maven.compiler.source}</testSource>
                    <testTarget>${maven.compiler.target}</testTarget>
                    <parameters>true</parameters>
                    <compilerArgs>
                        <arg>-Xlint:unchecked</arg>
                    </compilerArgs>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <configuration>
                    <checkstyleRules>
                        <module name="Checker">
                            <module name="RegexpHeader">
                                <property name="header" value="${checkstyle.header.template}" />
                                <property name="fileExtensions" value="${checkstyle.header.extensions}" />
                            </module>
                            <module name="TreeWalker">
                                <module name="RegexpSinglelineJava">
                                    <property name="format" value="@author" />
                                    <property name="message" value="No @author tag allowed" />
                                </module>
                            </module>
                        </module>
                    </checkstyleRules>
                    <outputFile>${project.build.directory}/checkstyle.log</outputFile>
                    <includeTestSourceDirectory>true</includeTestSourceDirectory>
                    <includeResources>true</includeResources>
                    <includeTestResources>true</includeTestResources>
                    <consoleOutput>false</consoleOutput>
                    <failsOnError>false</failsOnError>
                    <logViolationsToConsole>${checkstyle.logViolationsToConsole}</logViolationsToConsole>
                    <failOnViolation>${checkstyle.failOnViolation}</failOnViolation>
                    <sourceDirectories>
                        <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
                        <sourceDirectory>${project.build.testSourceDirectory}</sourceDirectory>
                    </sourceDirectories>
                </configuration>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.spotify.fmt</groupId>
                <artifactId>fmt-maven-plugin</artifactId>
                <configuration>
                    <sourceDirectory>src/main/java</sourceDirectory>
                    <testSourceDirectory>src/test/java</testSourceDirectory>
                    <verbose>false</verbose>
                    <filesNamePattern>.*\.java</filesNamePattern>
                    <skip>false</skip>
                    <skipSortingImports>false</skipSortingImports>
                    <style>google</style>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>format</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

        </plugins>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>${version.nexus.plugin}</version>
                    <extensions>true</extensions>
                    <configuration>
                        <serverId>ossrh</serverId>
                        <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                        <autoReleaseAfterClose>true</autoReleaseAfterClose>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>${version.gpg.plugin}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>${version.deploy.plugin}</version>
                    <configuration>
                        <retryFailedDeploymentCount>10</retryFailedDeploymentCount>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>${version.enforcer.plugin}</version>
                    <executions>
                        <execution>
                            <id>enforce-versions</id>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                            <configuration>
                                <rules>
                                    <requireMavenVersion>
                                        <version>${version.maven}</version>
                                    </requireMavenVersion>
                                    <requireJavaVersion>
                                        <version>${version.jdk}</version>
                                    </requireJavaVersion>
                                </rules>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${version.source.plugin}</version>
                    <executions>
                        <execution>
                            <id>attach-sources</id>
                            <goals>
                                <goal>jar-no-fork</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <archive>
                            <index>true</index>
                            <manifest>
                                <addDefaultSpecificationEntries>
                                    true
                                </addDefaultSpecificationEntries>
                                <addDefaultImplementationEntries>
                                    true
                                </addDefaultImplementationEntries>
                            </manifest>
                            <manifestEntries>
                                <Implementation-URL>${project.url}</Implementation-URL>
                                <Java-Version>${java.version}</Java-Version>
                                <Java-Vendor>${java.vendor}</Java-Vendor>
                                <Os-Name>${os.name}</Os-Name>
                                <Os-Arch>${os.arch}</Os-Arch>
                                <Os-Version>${os.version}</Os-Version>
                                <Scm-Url>${project.scm.url}</Scm-Url>
                                <Scm-Connection>${project.scm.connection}</Scm-Connection>
                                <Scm-Revision>${buildNumber}</Scm-Revision>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>${version.release.plugin}</version>
                    <configuration>
                        <preparationGoals>clean install</preparationGoals>
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                        <tagNameFormat>@{project.version}</tagNameFormat>
                        <pushChanges>false</pushChanges>
                        <localCheckout>true</localCheckout>
                        <remoteTagging>false</remoteTagging>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.jsonschema2pojo</groupId>
                    <artifactId>jsonschema2pojo-maven-plugin</artifactId>
                    <version>${version.jsonschema2pojo-maven-plugin}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${version.surefire.plugin}</version>
                    <configuration>
                        <argLine>-Xmx1024m -XX:+IgnoreUnrecognizedVMOptions -XX:MaxPermSize=256m</argLine>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>${version.failsafe.plugin}</version>
                    <configuration>
                        <argLine>-Xmx1024m -XX:+IgnoreUnrecognizedVMOptions -XX:MaxPermSize=256m</argLine>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>${version.checkstyle.plugin}</version>
                </plugin>
                <plugin>
                    <groupId>com.spotify.fmt</groupId>
                    <artifactId>fmt-maven-plugin</artifactId>
                    <version>${version.fmt-maven-plugin}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${version.jar.plugin}</version>
                    <configuration>
                        <archive>
                            <index>true</index>
                            <manifest>
                                <addDefaultSpecificationEntries>
                                    true
                                </addDefaultSpecificationEntries>
                                <addDefaultImplementationEntries>
                                    true
                                </addDefaultImplementationEntries>
                            </manifest>
                            <manifestEntries>
                                <Implementation-URL>${project.url}</Implementation-URL>
                                <Java-Version>${java.version}</Java-Version>
                                <Java-Vendor>${java.vendor}</Java-Vendor>
                                <Os-Name>${os.name}</Os-Name>
                                <Os-Arch>${os.arch}</Os-Arch>
                                <Os-Version>${os.version}</Os-Version>
                                <Scm-Url>${project.scm.url}</Scm-Url>
                                <Scm-Connection>${project.scm.connection}</Scm-Connection>
                                <Scm-Revision>${buildNumber}</Scm-Revision>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${version.javadoc.plugin}</version>
                    <configuration>
                        <failOnError>false</failOnError>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh-snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <pluginRepositories>
        <pluginRepository>
            <id>central</id>
            <name>Central Repository</name>
            <url>https://repo.maven.apache.org/maven2</url>
            <layout>default</layout>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <configuration>
                            <gpgArguments>
                                <arg>--pinentry-mode</arg>
                                <arg>loopback</arg>
                            </gpgArguments>
                        </configuration>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
