<?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>ga.rugal</groupId>
  <artifactId>parent</artifactId>
  <version>1.4.0</version>
  <packaging>pom</packaging>
  <url>https://rug.al</url>
  <name>Parent POM object for Rugal</name>
  <description>This is to simplify Spring Boot based project configuration</description>

  <scm>
    <connection>scm:git:ssh://git@github.com/Rugal/${project.artifactId}.git</connection>
    <developerConnection>scm:git:ssh://git@github.com/Rugal/${project.artifactId}.git</developerConnection>
    <url>https://github.com/Rugal/parent</url>
    <tag>v1.4.0</tag>
  </scm>

  <developers>
    <developer>
      <name>Rugal Bernstein</name>
      <email>this@rug.al</email>
    </developer>
  </developers>

  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <properties>
    <!--
        configuration
    -->
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <java.version>11</java.version>
    <!-- repository -->
    <sonatype.snapshot>https://oss.sonatype.org/content/repositories/snapshots</sonatype.snapshot>
    <sonatype.staging>https://oss.sonatype.org/service/local/staging/deploy/maven2/</sonatype.staging>
    <sonatype.release>https://oss.sonatype.org/content/repositories/releases/</sonatype.release>
    <!-- test toggle -->
    <skip.surefire.tests>true</skip.surefire.tests>
    <skip.failsafe.tests>true</skip.failsafe.tests>
    <!-- surefire -->
    <surefire.report.path>${project.build.directory}/surefire-reports</surefire.report.path>
    <surefire.agent.path>${surefire.report.path}/jacoco.exec</surefire.agent.path>
    <jacoco.surefire.report.path>${project.reporting.outputDirectory}/jacoco/surefire</jacoco.surefire.report.path>
    <!-- failsafe -->
    <failsafe.report.path>${project.build.directory}/failsafe-reports</failsafe.report.path>
    <failsafe.agent.path>${failsafe.report.path}/jacoco.exec</failsafe.agent.path>
    <jacoco.failsafe.report.path>${project.reporting.outputDirectory}/jacoco/failsafe</jacoco.failsafe.report.path>
    <!-- overall -->
    <overall.report.path>${project.build.directory}/overall-reports</overall.report.path>
    <overall.agent.path>${overall.report.path}/jacoco.exec</overall.agent.path>
    <jacoco.overall.report.path>${project.reporting.outputDirectory}/jacoco/overall</jacoco.overall.report.path>
    <jacoco.skip.coverage.check>true</jacoco.skip.coverage.check>
    <!-- openapi codegen server -->
    <openapi.codegen.package.root>${project.groupId}.${project.artifactId}.openapi</openapi.codegen.package.root>
    <openapi.codegen.model.package>${openapi.codegen.package.root}.model</openapi.codegen.model.package>
    <openapi.codegen.api.package>${openapi.codegen.package.root}.api</openapi.codegen.api.package>
    <openapi.codegen.invoker.package>${openapi.codegen.package.root}.invoker</openapi.codegen.invoker.package>
    <!--
        dependency version
    -->
    <servlet.version>4.0.1</servlet.version>
    <lombok.version>1.18.6</lombok.version>
    <spring.cloud.dependency.version>Greenwich.SR2</spring.cloud.dependency.version>
    <spring.boot.dependency.version>2.1.6.RELEASE</spring.boot.dependency.version>
    <mapstruct.version>1.3.0.Final</mapstruct.version>
    <swagger.version>1.5.21</swagger.version>
    <openapi.jackson.version>0.1.0</openapi.jackson.version>
    <springfox.version>2.9.2</springfox.version>
    <swagger.codegen.version>2.4.1</swagger.codegen.version>
    <faker.version>0.18</faker.version>
    <mockito.version>2.28.2</mockito.version>
    <hibernate.validator.version>5.4.3.Final</hibernate.validator.version>
    <puppycrawl.version>8.22</puppycrawl.version>
    <javax.inject.version>1</javax.inject.version>
    <maven.plugin.development.version>3.6.0</maven.plugin.development.version>
    <testing-harness.version>3.3.0</testing-harness.version>
    <!--
        plugin version
    -->
    <compiler.plugin.version>3.8.0</compiler.plugin.version>
    <git.commit.id.plugin.version>2.2.6</git.commit.id.plugin.version>
    <test.plugin.version>2.22.1</test.plugin.version>
    <source.plugin.version>3.1.0</source.plugin.version>
    <jacoco.plugin.version>0.8.4</jacoco.plugin.version>
    <deploy.plugin.version>2.8.2</deploy.plugin.version>
    <nexus.staging.plugin.version>1.6.8</nexus.staging.plugin.version>
    <gpg.plugin.version>1.6</gpg.plugin.version>
    <release.plugin.version>2.5.3</release.plugin.version>
    <checkstyle.plugin.version>3.1.0</checkstyle.plugin.version>
    <findbugs.plugin.version>3.0.5</findbugs.plugin.version>
    <spotbugs.plugin.version>3.1.11</spotbugs.plugin.version>
    <pmd.plugin.version>3.12.0</pmd.plugin.version>
    <flyway.version>5.2.4</flyway.version>
    <buildplan.plugin.version>1.3</buildplan.plugin.version>
    <openapi.plugin.version>4.0.2</openapi.plugin.version>
    <build.helper.plugin.version>3.0.0</build.helper.plugin.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <!--
          dependecy train
      -->
      <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-dependencies</artifactId>
        <version>${spring.cloud.dependency.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>${spring.boot.dependency.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <!--
          servlet
      -->
      <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>${servlet.version}</version>
        <scope>provided</scope>
      </dependency>
      <!--
          codegen
      -->
      <!-- mapstruct -->
      <dependency>
        <groupId>org.mapstruct</groupId>
        <artifactId>mapstruct</artifactId>
        <version>${mapstruct.version}</version>
      </dependency>
      <!-- swagger annotation -->
      <dependency>
        <groupId>io.swagger</groupId>
        <artifactId>swagger-annotations</artifactId>
        <version>${swagger.version}</version>
      </dependency>
      <!-- swagger codegen -->
      <dependency>
        <groupId>io.swagger</groupId>
        <artifactId>swagger-codegen</artifactId>
        <version>${swagger.codegen.version}</version>
      </dependency>
      <!-- swagger UI -->
      <dependency>
        <groupId>io.springfox</groupId>
        <artifactId>springfox-swagger2</artifactId>
        <version>${springfox.version}</version>
      </dependency>
      <dependency>
        <groupId>io.springfox</groupId>
        <artifactId>springfox-swagger-ui</artifactId>
        <version>${springfox.version}</version>
      </dependency>
      <dependency>
        <groupId>io.springfox</groupId>
        <artifactId>springfox-bean-validators</artifactId>
        <version>${springfox.version}</version>
      </dependency>
      <!-- openapi tool -->
      <dependency>
        <groupId>org.openapitools</groupId>
        <artifactId>jackson-databind-nullable</artifactId>
        <version>${openapi.jackson.version}</version>
      </dependency>
      <!--
          test
      -->
      <!-- faker -->
      <dependency>
        <groupId>com.github.javafaker</groupId>
        <artifactId>javafaker</artifactId>
        <version>${faker.version}</version>
        <scope>test</scope>
      </dependency>
      <!-- mockito -->
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>${mockito.version}</version>
        <scope>test</scope>
      </dependency>
      <!--
          JEP
      -->
      <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-validator</artifactId>
      </dependency>
      <!-- 
          maven plugin development
      -->
      <dependency>
        <groupId>javax.inject</groupId>
        <artifactId>javax.inject</artifactId>
        <version>${javax.inject.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-artifact</artifactId>
        <version>${maven.plugin.development.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-compat</artifactId>
        <version>${maven.plugin.development.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-core</artifactId>
        <version>${maven.plugin.development.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-plugin-api</artifactId>
        <version>${maven.plugin.development.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven.plugin-tools</groupId>
        <artifactId>maven-plugin-annotations</artifactId>
        <version>${maven.plugin.development.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven.plugin-testing</groupId>
        <artifactId>maven-plugin-testing-harness</artifactId>
        <version>${testing-harness.version}</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <pluginManagement>
      <plugins>
        <!-- checkstyle -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>${checkstyle.plugin.version}</version>
          <configuration>
            <configLocation>configuration/checkstyle/checkstyle.xml</configLocation>
            <suppressionsLocation>configuration/checkstyle/suppression.xml</suppressionsLocation>
            <excludes>target/**/*,**/dto/**/*, **/ExceptionController.java</excludes>
            <encoding>${project.build.sourceEncoding}</encoding>
            <consoleOutput>true</consoleOutput>
            <failsOnError>true</failsOnError>
            <failOnViolation>true</failOnViolation>
            <violationSeverity>info</violationSeverity>
            <linkXRef>false</linkXRef>
            <skip>false</skip>
          </configuration>
          <dependencies>
            <dependency>
              <groupId>com.puppycrawl.tools</groupId>
              <artifactId>checkstyle</artifactId>
              <version>${puppycrawl.version}</version>
            </dependency>
          </dependencies>
          <executions>
            <execution>
              <phase>validate</phase>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <!-- findbugs -->
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>findbugs-maven-plugin</artifactId>
          <version>${findbugs.plugin.version}</version>
          <configuration>
            <skip>false</skip>
            <failOnError>true</failOnError>
            <effort>Max</effort>
            <threshold>Low</threshold>
            <xmlOutput>true</xmlOutput>
            <outputDirectory>${project.build.directory}/findbugs</outputDirectory>
            <excludeFilterFile>configuration/findbugs/exclude.xml</excludeFilterFile>
          </configuration>
          <executions>
            <execution>
              <phase>validate</phase>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <!-- spotbugs -->
        <plugin>
          <groupId>com.github.spotbugs</groupId>
          <artifactId>spotbugs-maven-plugin</artifactId>
          <version>${spotbugs.plugin.version}</version>
          <configuration>
            <skip>false</skip>
            <failOnError>true</failOnError>
            <effort>Max</effort>
            <threshold>Low</threshold>
            <xmlOutput>true</xmlOutput>
            <outputDirectory>${project.build.directory}/findbugs</outputDirectory>
            <excludeFilterFile>configuration/findbugs/exclude.xml</excludeFilterFile>
          </configuration>
          <executions>
            <execution>
              <phase>validate</phase>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <!-- PMD -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-pmd-plugin</artifactId>
          <version>${pmd.plugin.version}</version>
          <configuration>
            <skip>false</skip>
            <failOnViolation>true</failOnViolation>
            <printFailingErrors>true</printFailingErrors>
            <linkXRef>false</linkXRef>
            <analysisCache>true</analysisCache>
            <analysisCacheLocation>${project.build.directory}/pmd.cache</analysisCacheLocation>
            <excludes>
              <exclude>**/generated/**/*.java</exclude>
            </excludes>
            <excludeRoots>
              <excludeRoot>target/generated-sources</excludeRoot>
            </excludeRoots>
          </configuration>
          <executions>
            <execution>
              <phase>validate</phase>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <!-- source -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>${source.plugin.version}</version>
          <executions>
            <execution>
              <id>attach-sources</id>
              <goals>
                <goal>jar-no-fork</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <!-- jar -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>${source.plugin.version}</version>
          <executions>
            <execution>
              <id>default-jar</id>
              <goals>
                <goal>jar</goal>
                <goal>test-jar</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
          </configuration>
        </plugin>
        <!-- javadoc -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${source.plugin.version}</version>
          <executions>
            <execution>
              <id>attach-javadocs</id>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <!-- deploy -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>${deploy.plugin.version}</version>
        </plugin>
        <!-- gpg -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>${gpg.plugin.version}</version>
          <executions>
            <execution>
              <id>sign-artifacts</id>
              <phase>verify</phase>
              <goals>
                <goal>sign</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <!-- release -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>${release.plugin.version}</version>
          <configuration>
            <tagNameFormat>v@{project.version}</tagNameFormat>
            <autoVersionSubmodules>true</autoVersionSubmodules>
            <useReleaseProfile>false</useReleaseProfile>
            <releaseProfiles>release</releaseProfiles>
            <goals>deploy</goals>
          </configuration>
        </plugin>
        <!-- nexus -->
        <plugin>
          <groupId>org.sonatype.plugins</groupId>
          <artifactId>nexus-staging-maven-plugin</artifactId>
          <version>${nexus.staging.plugin.version}</version>
          <extensions>true</extensions>
          <configuration>
            <serverId>ossrh</serverId>
            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
            <autoReleaseAfterClose>false</autoReleaseAfterClose>
          </configuration>
        </plugin>
        <!-- git commit id -->
        <plugin>
          <groupId>pl.project13.maven</groupId>
          <artifactId>git-commit-id-plugin</artifactId>
          <version>${git.commit.id.plugin.version}</version>
          <executions>
            <execution>
              <id>get-git-info</id>
              <goals>
                <goal>revision</goal>
              </goals>
              <phase>initialize</phase>
            </execution>
          </executions>
          <configuration>
            <failOnNoGitDirectory>false</failOnNoGitDirectory>
            <generateGitPropertiesFile>true</generateGitPropertiesFile>
            <verbose>false</verbose>
            <failOnNoGitDirectory>false</failOnNoGitDirectory>
            <generateGitPropertiesFilename>
              ${project.build.outputDirectory}/git.properties
            </generateGitPropertiesFilename>
            <gitDescribe>
              <skip>false</skip>
              <always>false</always>
              <dirty>-dirty</dirty>
            </gitDescribe>
          </configuration>
        </plugin>
        <!-- spring boot -->
        <plugin>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-maven-plugin</artifactId>
          <version>${spring.boot.dependency.version}</version>
          <executions>
            <execution>
              <goals>
                <goal>repackage</goal>
              </goals>
              <configuration>
                <classifier>exec</classifier>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <!--
            Test
        -->
        <!-- unit test -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${test.plugin.version}</version>
          <configuration>
            <argLine>-Djdk.net.URLClassPath.disableClassPathURLCheck=true ${jacoco.surefire.arg}</argLine>
            <excludes>
              <exclude>**/*IntegrationTest.java</exclude>
            </excludes>
            <parallel>classes</parallel>
            <reportsDirectory>${surefire.report.path}</reportsDirectory>
            <skipTests>${skip.surefire.tests}</skipTests>
            <trimStackTrace>false</trimStackTrace>
            <useUnlimitedThreads>true</useUnlimitedThreads>
          </configuration>
        </plugin>
        <!-- integration test -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>${test.plugin.version}</version>
          <configuration>
            <argLine>-Djdk.net.URLClassPath.disableClassPathURLCheck=true ${jacoco.failsafe.arg}</argLine>
            <includes>
              <include>**/*IntegrationTest.java</include>
            </includes>
            <parallel>classes</parallel>
            <reportsDirectory>${failsafe.report.path}</reportsDirectory>
            <skipTests>${skip.failsafe.tests}</skipTests>
            <trimStackTrace>false</trimStackTrace>
            <useUnlimitedThreads>true</useUnlimitedThreads>
          </configuration>
          <executions>
            <execution>
              <id>integration-tests</id>
              <goals>
                <goal>integration-test</goal>
                <goal>verify</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <!-- test coverage -->
        <plugin>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <version>${jacoco.plugin.version}</version>
          <!-- exclude from jacoco coverage -->
          <configuration>
            <excludes>
              <exclude>**/exception/*</exclude>
              <exclude>**/entity/*</exclude>
              <exclude>**/swagger/**</exclude>
              <exclude>**/openapi/**</exclude>
              <exclude>**/mapper/**</exclude>
              <exclude>**/config/**</exclude>
              <exclude>**/generated-sources/**</exclude>
            </excludes>
            <rules>
              <rule>
                <element>CLASS</element>
                <limits>
                  <limit>
                    <counter>LINE</counter>
                    <value>COVEREDRATIO</value>
                    <minimum>0.90</minimum>
                  </limit>
                  <limit>
                    <counter>BRANCH</counter>
                    <value>COVEREDRATIO</value>
                    <minimum>0.90</minimum>
                  </limit>
                </limits>
              </rule>
            </rules>
          </configuration>
          <executions>
            <!-- surefire report -->
            <execution>
              <id>prepare-surefire-agent</id>
              <phase>process-test-classes</phase>
              <goals>
                <goal>prepare-agent</goal>
              </goals>
              <configuration>
                <propertyName>jacoco.surefire.arg</propertyName>
                <destFile>${surefire.agent.path}</destFile>
                <append>true</append>
              </configuration>
            </execution>
            <execution>
              <id>post-unit-test</id>
              <phase>test</phase>
              <goals>
                <goal>report</goal>
              </goals>
              <configuration>
                <dataFile>${surefire.agent.path}</dataFile>
                <outputDirectory>${jacoco.surefire.report.path}</outputDirectory>
              </configuration>
            </execution>
            <!-- failsafe report -->
            <execution>
              <id>prepare-it-agent</id>
              <phase>pre-integration-test</phase>
              <goals>
                <goal>prepare-agent</goal>
              </goals>
              <configuration>
                <destFile>${failsafe.agent.path}</destFile>
                <propertyName>jacoco.failsafe.arg</propertyName>
                <append>true</append>
              </configuration>
            </execution>
            <execution>
              <id>post-integration-test</id>
              <phase>post-integration-test</phase>
              <goals>
                <goal>report</goal>
              </goals>
              <configuration>
                <dataFile>${failsafe.agent.path}</dataFile>
                <outputDirectory>${jacoco.failsafe.report.path}</outputDirectory>
              </configuration>
            </execution>
            <!-- overall report -->
            <execution>
              <id>merge-results</id>
              <phase>verify</phase>
              <goals>
                <goal>merge</goal>
              </goals>
              <configuration>
                <fileSets>
                  <fileSet>
                    <directory>${surefire.report.path}</directory>
                    <includes>
                      <include>*.exec</include>
                    </includes>
                  </fileSet>
                  <fileSet>
                    <directory>${failsafe.report.path}</directory>
                    <includes>
                      <include>*.exec</include>
                    </includes>
                  </fileSet>
                </fileSets>
                <destFile>${overall.agent.path}</destFile>
              </configuration>
            </execution>
            <execution>
              <id>post-merge-report</id>
              <phase>verify</phase>
              <goals>
                <goal>report</goal>
              </goals>
              <configuration>
                <dataFile>${overall.agent.path}</dataFile>
                <outputDirectory>${jacoco.overall.report.path}</outputDirectory>
              </configuration>
            </execution>
            <!-- fail build if rule not reach -->
            <execution>
              <id>jacoco-check</id>
              <configuration>
                <dataFile>${overall.agent.path}</dataFile>
                <skip>${jacoco.skip.coverage.check}</skip>
              </configuration>
              <phase>verify</phase>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <!-- openapi codegen -->
        <!--https://openapi-generator.tech/docs/generators.html-->
        <plugin>
          <groupId>org.openapitools</groupId>
          <artifactId>openapi-generator-maven-plugin</artifactId>
          <version>${openapi.plugin.version}</version>
          <configuration>
            <configOptions>
              <dateLibrary>java8</dateLibrary>
              <interfaceOnly>true</interfaceOnly>
            </configOptions>
            <enablePostProcessFile>false</enablePostProcessFile>
            <generateApis>true</generateApis>
            <generateApiDocumentation>false</generateApiDocumentation>
            <generateApiTests>false</generateApiTests>
            <generateModelDocumentation>false</generateModelDocumentation>
            <generateModelTests>false</generateModelTests>
            <generateSupportingFiles>false</generateSupportingFiles>
            <modelNameSuffix>Dto</modelNameSuffix>
            <skipIfSpecIsUnchanged>true</skipIfSpecIsUnchanged>
          </configuration>
          <executions>
            <execution>
              <id>openapi-codegen-server</id>
              <goals>
                <goal>generate</goal>
              </goals>
              <configuration>
                <apiPackage>${openapi.codegen.api.package}</apiPackage>
                <configOptions>
                  <java8>false</java8>
                  <library>spring-boot</library>
                </configOptions>
                <inputSpec>configuration/openapi/contract.yml</inputSpec>
                <invokerPackage>${openapi.codegen.invoker.package}</invokerPackage>
                <generatorName>spring</generatorName>
                <modelPackage>${openapi.codegen.model.package}</modelPackage>
              </configuration>
            </execution>
            <execution>
              <id>openapi-codegen-client</id>
              <goals>
                <goal>generate</goal>
              </goals>
              <configuration>
                <apiPackage>${openapi.codegen.package.root}.client.api</apiPackage>
                <configOptions>
                  <library>resttemplate</library>
                </configOptions>
                <inputSpec>configuration/openapi/contract.yml</inputSpec>
                <invokerPackage>${openapi.codegen.package.root}.client.invoker</invokerPackage>
                <generatorName>java</generatorName>
                <modelPackage>${openapi.codegen.package.root}.client.model</modelPackage>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <!-- flyway plugin -->
        <plugin>
          <groupId>org.flywaydb</groupId>
          <artifactId>flyway-maven-plugin</artifactId>
          <version>${flyway.version}</version>
          <configuration>
            <schemas>
              <schema>test</schema>
            </schemas>
            <installedBy>Rugal Bernstein</installedBy>
            <configFile>configuration/db/local.properties</configFile>
            <locations>filesystem:configuration/db/migration</locations>
          </configuration>
        </plugin>
        <!-- compiler -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${compiler.plugin.version}</version>
          <configuration>
            <source>${java.version}</source>
            <target>${java.version}</target>
            <!--to enable different java build version-->
            <fork>true</fork>
            <annotationProcessorPaths>
              <path>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>${lombok.version}</version>
              </path>
              <path>
                <groupId>org.mapstruct</groupId>
                <artifactId>mapstruct-processor</artifactId>
                <version>${mapstruct.version}</version>
              </path>
            </annotationProcessorPaths>
            <compilerArgs>
              <compilerArg>
                -Amapstruct.defaultComponentModel=spring
              </compilerArg>
            </compilerArgs>
          </configuration>
        </plugin>
        <!-- plugin management -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-plugin-plugin</artifactId>
          <version>${maven.plugin.development.version}</version>
          <configuration>
            <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
          </configuration>
          <executions>
            <execution>
              <id>mojo-descriptor</id>
              <phase>process-classes</phase>
              <goals>
                <goal>descriptor</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <!-- build helper maven -->
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>${build.helper.plugin.version}</version>
          <executions>
            <execution>
              <id>add_sources</id>
              <phase>generate-sources</phase>
              <goals>
                <goal>add-source</goal>
              </goals>
              <configuration>
                <sources>
                  <source>src/main/java</source>
                </sources>
              </configuration>
            </execution>
            <execution>
              <id>add_test_sources</id>
              <phase>generate-test-sources</phase>
              <goals>
                <goal>add-test-source</goal>
              </goals>
              <configuration>
                <sources>
                  <source>src/test/java</source>
                </sources>
              </configuration>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <!-- build plan -->
      <plugin>
        <groupId>fr.jcgay.maven.plugins</groupId>
        <artifactId>buildplan-maven-plugin</artifactId>
        <version>${buildplan.plugin.version}</version>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <!--only activate for releasing to sonatype-->
    <profile>
      <id>sonatype</id>
      <build>
        <plugins>
          <!-- gpg -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <url>${sonatype.snapshot}</url>
    </snapshotRepository>
    <repository>
      <id>ossrh</id>
      <url>${sonatype.staging}</url>
    </repository>
  </distributionManagement>

  <repositories>
    <repository>
      <id>ossrh</id>
      <name>Sonatype snapshot repository</name>
      <url>${sonatype.snapshot}</url>
      <layout>default</layout>
      <releases>
        <enabled>false</enabled>
        <updatePolicy>always</updatePolicy>
        <checksumPolicy>warn</checksumPolicy>
      </releases>
      <snapshots>
        <enabled>true</enabled>
        <updatePolicy>never</updatePolicy>
        <checksumPolicy>fail</checksumPolicy>
      </snapshots>
    </repository>
  </repositories>
</project>
