<?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>
  <groupId>org.bonitasoft.web</groupId>
  <artifactId>bonita-java-client</artifactId>
  <version>2.0.0</version>
  <packaging>jar</packaging>
  <name>bonita-java-client</name>
  <description>Java client for Bonita REST API</description>
  <url>https://www.bonitasoft.com</url>
  <licenses>
    <license>
      <name>GPL-v2.0</name>
      <url>http://www.gnu.org/licenses/gpl-2.0.txt</url>
    </license>
  </licenses>
  <developers>
    <developer>
      <id>bonitasoft</id>
      <name>Bonitasoft</name>
      <email>rd.user@bonitasoft.com</email>
      <organization>Bonitasoft</organization>
      <organizationUrl>https://www.bonitasoft.com</organizationUrl>
    </developer>
  </developers>
  <scm>
    <connection>scm:git:git@github.com:bonitasoft/bonita-java-client.git</connection>
    <developerConnection>scm:git:git@github.com:bonitasoft/bonita-java-client.git</developerConnection>
    <tag>HEAD</tag>
    <url>https://github.com/bonitasoft/bonita-java-client</url>
  </scm>
  <distributionManagement>
    <repository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
    <!-- Central Repository -->
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>
  <properties>
    <!-- Maven -->
    <!-- Compiled with Java 17, but use bytecode version 11 to ensure compatibility with older maintenance versions. -->
    <java.version>11</java.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <!-- Bonita -->
    <bonita-openapi.version>0.0.21</bonita-openapi.version>
    <swagger-annotations.version>1.6.14</swagger-annotations.version>
    <jakarta-annotation.version>3.0.0</jakarta-annotation.version>
    <jsr305.version>3.0.2</jsr305.version>
    <feign.version>13.4</feign.version>
    <feign-form.version>3.8.0</feign-form.version>
    <okhttp.version>4.12.0</okhttp.version>
    <scribejava.version>8.3.3</scribejava.version>
    <jackson.version>2.18.0</jackson.version>
    <jackson-databind-nullable.version>0.2.6</jackson-databind-nullable.version>
    <lombok.version>1.18.34</lombok.version>
    <slf4j-api.version>2.0.16</slf4j-api.version>
    <!-- Tests -->
    <junit-jupiter-engine.version>5.11.0</junit-jupiter-engine.version>
    <assertj-core.version>3.26.3</assertj-core.version>
    <mockito-core.version>5.14.1</mockito-core.version>
    <logback-classic.version>1.5.8</logback-classic.version>
    <testcontainers.version>1.20.1</testcontainers.version>
    <awaitility.version>4.2.2</awaitility.version>
    <semver4j.version>3.1.0</semver4j.version>
    <!-- Maven plugins -->
    <maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
    <maven.compiler.release>${java.version}</maven.compiler.release>
    <maven-surefire-plugin.version>3.5.0</maven-surefire-plugin.version>
    <maven-failsafe-plugin.version>3.5.0</maven-failsafe-plugin.version>
    <jacoco-maven-plugin.version>0.8.12</jacoco-maven-plugin.version>
    <sonar-maven-plugin.version>4.0.0.4121</sonar-maven-plugin.version>
    <nexus-staging-maven-plugin.version>1.7.0</nexus-staging-maven-plugin.version>
    <gitflow-maven-plugin.version>1.21.0</gitflow-maven-plugin.version>
    <maven-javadoc-plugin.version>3.10.0</maven-javadoc-plugin.version>
    <maven-source-plugin.version>3.3.1</maven-source-plugin.version>
    <maven-gpg-plugin.version>3.2.7</maven-gpg-plugin.version>
    <git-commit-id-plugin.version>4.9.10</git-commit-id-plugin.version>
    <openapi-generator-maven-plugin.version>7.8.0</openapi-generator-maven-plugin.version>
    <spotless-maven-plugin.version>2.43.0</spotless-maven-plugin.version>
    <groovy-maven-plugin.version>2.1.1</groovy-maven-plugin.version>
    <groovy.version>3.0.22</groovy.version>
    <!-- Configuration properties -->
    <codegen.skip>true</codegen.skip>
    <maven.javadoc.skip>true</maven.javadoc.skip>
    <!-- Sonar -->
    <sonar.projectKey>${sonar.organization}_${project.artifactId}</sonar.projectKey>
    <sonar.organization>bonitasoft</sonar.organization>
    <sonar.host.url>https://sonarcloud.io</sonar.host.url>
    <sonar.exclusions>**/api/**,**/invoker/**,**/model/**,**/invoker/auth/ApiKeyAuth*,**/invoker/auth/HttpBasicAuth*,**/invoker/auth/HttpBearerAuth*,src/test/java/**,pom.xml</sonar.exclusions>
    <sonar.coverage.jacoco.xmlReportPaths>${project.reporting.outputDirectory}/jacoco/jacoco.xml,${project.reporting.outputDirectory}/jacoco-it/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
  </properties>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j-api.version}</version>
      </dependency>
      <dependency>
        <groupId>com.fasterxml.jackson</groupId>
        <artifactId>jackson-bom</artifactId>
        <version>${jackson.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>io.github.openfeign</groupId>
        <artifactId>feign-bom</artifactId>
        <version>${feign.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.junit</groupId>
        <artifactId>junit-bom</artifactId>
        <version>${junit-jupiter-engine.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.testcontainers</groupId>
        <artifactId>testcontainers-bom</artifactId>
        <version>${testcontainers.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>io.swagger</groupId>
      <artifactId>swagger-annotations</artifactId>
      <version>${swagger-annotations.version}</version>
    </dependency>
    <!-- @Nullable annotation -->
    <dependency>
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>jsr305</artifactId>
      <version>${jsr305.version}</version>
    </dependency>
    <dependency>
      <groupId>jakarta.annotation</groupId>
      <artifactId>jakarta.annotation-api</artifactId>
      <version>${jakarta-annotation.version}</version>
      <scope>provided</scope>
    </dependency>
    <!-- HTTP client: Netflix Feign -->
    <dependency>
      <groupId>io.github.openfeign</groupId>
      <artifactId>feign-jackson</artifactId>
    </dependency>
    <dependency>
      <groupId>io.github.openfeign</groupId>
      <artifactId>feign-slf4j</artifactId>
      <exclusions>
        <exclusion>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-api</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>io.github.openfeign</groupId>
      <artifactId>feign-okhttp</artifactId>
    </dependency>
    <dependency>
      <groupId>io.github.openfeign.form</groupId>
      <artifactId>feign-form</artifactId>
      <version>${feign-form.version}</version>
    </dependency>
    <dependency>
      <groupId>com.squareup.okhttp3</groupId>
      <artifactId>okhttp</artifactId>
      <version>${okhttp.version}</version>
    </dependency>
    <dependency>
      <groupId>com.squareup.okhttp3</groupId>
      <artifactId>logging-interceptor</artifactId>
      <version>${okhttp.version}</version>
    </dependency>
    <!-- OAuth support-->
    <dependency>
      <groupId>com.github.scribejava</groupId>
      <artifactId>scribejava-httpclient-okhttp</artifactId>
      <version>${scribejava.version}</version>
    </dependency>
    <!-- JSON processing: jackson -->
    <dependency>
      <groupId>com.fasterxml.jackson.datatype</groupId>
      <artifactId>jackson-datatype-jsr310</artifactId>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.datatype</groupId>
      <artifactId>jackson-datatype-jdk8</artifactId>
    </dependency>
    <dependency>
      <groupId>org.openapitools</groupId>
      <artifactId>jackson-databind-nullable</artifactId>
      <version>${jackson-databind-nullable.version}</version>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.module</groupId>
      <artifactId>jackson-module-blackbird</artifactId>
    </dependency>
    <!-- Misc -->
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <version>${lombok.version}</version>
      <scope>provided</scope>
      <optional>true</optional>
    </dependency>
    <!-- Tests -->
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-params</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>${assertj-core.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-junit-jupiter</artifactId>
      <version>${mockito-core.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.testcontainers</groupId>
      <artifactId>junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <version>${logback-classic.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>jul-to-slf4j</artifactId>
      <version>${slf4j-api.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.awaitility</groupId>
      <artifactId>awaitility</artifactId>
      <version>${awaitility.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.vdurmont</groupId>
      <artifactId>semver4j</artifactId>
      <version>${semver4j.version}</version>
    </dependency>
  </dependencies>
  <build>
    <defaultGoal>package</defaultGoal>
    <resources>
      <resource>
        <filtering>true</filtering>
        <directory>src/main/resources-filtered</directory>
      </resource>
      <resource>
        <filtering>false</filtering>
        <directory>src/main/resources</directory>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <filtering>false</filtering>
        <directory>src/test/resources</directory>
      </testResource>
      <testResource>
        <filtering>true</filtering>
        <directory>src/test/resources-filtered</directory>
      </testResource>
    </testResources>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>${maven-source-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${maven-compiler-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${maven-javadoc-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>${maven-gpg-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${maven-surefire-plugin.version}</version>
          <configuration>
            <enableAssertions>true</enableAssertions>
            <forkCount>1</forkCount>
            <reuseForks>true</reuseForks>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>${maven-failsafe-plugin.version}</version>
          <configuration>
            <enableAssertions>true</enableAssertions>
            <forkCount>1</forkCount>
            <reuseForks>true</reuseForks>
          </configuration>
          <executions>
            <execution>
              <goals>
                <goal>integration-test</goal>
                <goal>verify</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <version>${jacoco-maven-plugin.version}</version>
          <configuration>
            <excludes>
              <exclude>org/bonitasoft/web/client/api/*</exclude>
              <exclude>org/bonitasoft/web/client/invoker/*</exclude>
              <exclude>org/bonitasoft/web/client/model/*</exclude>
              <exclude>org/bonitasoft/web/client/invoker/auth/ApiKeyAuth*</exclude>
              <exclude>org/bonitasoft/web/client/invoker/auth/HttpBasicAuth*</exclude>
              <exclude>org/bonitasoft/web/client/invoker/auth/HttpBearerAuth*</exclude>
            </excludes>
          </configuration>
          <executions>
            <execution>
              <id>prepare-agent</id>
              <goals>
                <goal>prepare-agent</goal>
              </goals>
            </execution>
            <execution>
              <id>prepare-agent-integration</id>
              <goals>
                <goal>prepare-agent-integration</goal>
              </goals>
            </execution>
            <execution>
              <id>jacoco-test-report</id>
              <goals>
                <goal>report</goal>
              </goals>
            </execution>
            <execution>
              <id>jacoco-it-report</id>
              <goals>
                <goal>report-integration</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.sonarsource.scanner.maven</groupId>
          <artifactId>sonar-maven-plugin</artifactId>
          <version>${sonar-maven-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.sonatype.plugins</groupId>
          <artifactId>nexus-staging-maven-plugin</artifactId>
          <version>${nexus-staging-maven-plugin.version}</version>
          <extensions>true</extensions>
          <configuration>
            <serverId>ossrh</serverId>
            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
            <autoReleaseAfterClose>false</autoReleaseAfterClose>
          </configuration>
        </plugin>
        <plugin>
          <groupId>com.amashchenko.maven.plugin</groupId>
          <artifactId>gitflow-maven-plugin</artifactId>
          <version>${gitflow-maven-plugin.version}</version>
          <configuration>
            <versionsMavenPluginVersion>${versions-maven-plugin.version}</versionsMavenPluginVersion>
            <!-- 0: increment major digit on develop, 1: increment minor digit on develop, 2: increment patch digit on develop -->
            <versionDigitToIncrement>1</versionDigitToIncrement>
            <commitMessagePrefix xml:space="preserve">chore(release): </commitMessagePrefix>
          </configuration>
        </plugin>
        <plugin>
          <groupId>com.diffplug.spotless</groupId>
          <artifactId>spotless-maven-plugin</artifactId>
          <version>${spotless-maven-plugin.version}</version>
          <configuration>
            <pom>
              <sortPom>
                <encoding>UTF-8</encoding>
                <lineSeparator>${line.separator}</lineSeparator>
                <expandEmptyElements>true</expandEmptyElements>
                <spaceBeforeCloseEmptyElement>false</spaceBeforeCloseEmptyElement>
                <keepBlankLines>false</keepBlankLines>
                <nrOfIndentSpace>2</nrOfIndentSpace>
                <indentBlankLines>false</indentBlankLines>
                <indentSchemaLocation>false</indentSchemaLocation>
                <predefinedSortOrder>recommended_2008_06</predefinedSortOrder>
                <sortOrderFile></sortOrderFile>
                <sortDependencies></sortDependencies>
                <sortDependencyExclusions></sortDependencyExclusions>
                <sortPlugins></sortPlugins>
                <sortProperties>false</sortProperties>
                <sortModules>false</sortModules>
                <sortExecutions>false</sortExecutions>
              </sortPom>
            </pom>
            <java>
              <eclipse>
                <file>${project.basedir}/src/format/formatter.xml</file>
              </eclipse>
              <importOrder>
                <file>${project.basedir}/src/format/eclipse.importorder</file>
              </importOrder>
              <removeUnusedImports></removeUnusedImports>
              <licenseHeader>
                <file>${project.basedir}/src/format/header.txt</file>
              </licenseHeader>
            </java>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.codehaus.gmaven</groupId>
          <artifactId>groovy-maven-plugin</artifactId>
          <version>${groovy-maven-plugin.version}</version>
          <dependencies>
            <dependency>
              <groupId>org.codehaus.groovy</groupId>
              <artifactId>groovy</artifactId>
              <version>${groovy.version}</version>
            </dependency>
          </dependencies>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.openapitools</groupId>
        <artifactId>openapi-generator-maven-plugin</artifactId>
        <version>${openapi-generator-maven-plugin.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <generateApiTests>false</generateApiTests>
              <generateModelTests>false</generateModelTests>
              <generateApiDocumentation>false</generateApiDocumentation>
              <generateModelDocumentation>false</generateModelDocumentation>
              <output>${project.basedir}</output>
              <skipIfSpecIsUnchanged>true</skipIfSpecIsUnchanged>
              <inputSpec>${project.basedir}/api/openapi.yaml</inputSpec>
              <generatorName>java</generatorName>
              <invokerPackage>org.bonitasoft.web.client.invoker</invokerPackage>
              <apiPackage>org.bonitasoft.web.client.api</apiPackage>
              <modelPackage>org.bonitasoft.web.client.model</modelPackage>
              <configOptions>
                <dateLibrary>java8</dateLibrary>
                <useJakartaEe>true</useJakartaEe>
                <serializableModel>true</serializableModel>
                <serializationLibrary>jackson</serializationLibrary>
                <library>feign</library>
                <hideGenerationTimestamp>true</hideGenerationTimestamp>
                <useOneOfInterfaces>true</useOneOfInterfaces>
              </configOptions>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>check</goal>
            </goals>
            <phase>compile</phase>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>pl.project13.maven</groupId>
        <artifactId>git-commit-id-plugin</artifactId>
        <version>${git-commit-id-plugin.version}</version>
        <configuration>
          <failOnNoGitDirectory>false</failOnNoGitDirectory>
          <generateGitPropertiesFile>true</generateGitPropertiesFile>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>revision</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
      </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>
        <groupId>org.codehaus.gmaven</groupId>
        <artifactId>groovy-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>update-spec</id>
            <goals>
              <goal>execute</goal>
            </goals>
            <phase>none</phase>
            <configuration>
              <source>${project.basedir}/src/script/update-bonita-openapi-spec.groovy</source>
              <defaults>
                <basedir>${project.basedir}</basedir>
                <bonita-openapi.version>${bonita-openapi.version}</bonita-openapi.version>
              </defaults>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <!-- Deployment profile (required so these plugins are only used when
			deploying) -->
    <profile>
      <id>deploy</id>
      <properties>
        <maven.javadoc.skip>false</maven.javadoc.skip>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>${maven-gpg-plugin.version}</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <goals>
                  <goal>sign</goal>
                </goals>
                <phase>verify</phase>
                <configuration>
                  <gpgArguments>
                    <arg>--pinentry-mode</arg>
                    <arg>loopback</arg>
                  </gpgArguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
