<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>io.github.onecx</groupId>
    <artifactId>onecx-quarkus2-parent</artifactId>
    <version>0.17.0</version>
    <name>onecx-quarkus2-parent</name>
    <packaging>pom</packaging>

    <description>Onecx Quarkus application parent</description>
    <url>https://github.com/onecx/onecx-quarkus2-parent</url>

    <organization>
        <name>onecx</name>
        <url>https://github.com/onecx</url>
    </organization>

    <developers>
        <developer>
            <id>tkit-dev</id>
            <name>tkit-dev</name>
            <organization>onecx</organization>
            <organizationUrl>https://github.com/onecx</organizationUrl>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>Apache 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:onecx/onecx-quarkus2-parent.git</connection>
        <developerConnection>scm:git:git@github.com:onecx/onecx-quarkus2-parent.git</developerConnection>
        <url>https://github.com/onecx/onecx-quarkus2-parent</url>
    </scm>

    <properties>
        <!-- build -->
        <format.skip>false</format.skip>
        <enforcer.skip>false</enforcer.skip>
        <enforce-test-deps-scope.skip>${enforcer.skip}</enforce-test-deps-scope.skip>

        <!-- Quarkus configuration -->
        <quarkus.version>2.16.7.Final</quarkus.version>
        <quarkus.smallrye-open-api.version>3.1.1</quarkus.smallrye-open-api.version>
        <quarkiverse.quarkus-openapi-generator.version>1.3.1</quarkiverse.quarkus-openapi-generator.version>
        <quarkiverse.mockserver.version>0.6.0</quarkiverse.mockserver.version>

        <!-- tkit -->
        <tkit.quarkus.version>0.16.0</tkit.quarkus.version>

        <!-- Maven configuration -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <maven.compiler.release>17</maven.compiler.release>
        <maven.compiler.parameters>true</maven.compiler.parameters>
        <maven.compiler-plugin.version>3.10.1</maven.compiler-plugin.version>
        <maven.surefire-plugin.version>3.0.0</maven.surefire-plugin.version>
        <maven.formatter-plugin.version>2.22.0</maven.formatter-plugin.version>
        <maven.impsort-plugin.version>1.8.0</maven.impsort-plugin.version>
        <maven.enforcer-plugin.version>3.2.1</maven.enforcer-plugin.version>

        <!-- Maven central release configuration -->
        <nexus.staging-plugin.version>1.6.13</nexus.staging-plugin.version>
        <source-plugin.version>3.2.1</source-plugin.version>
        <javadoc-plugin.version>3.5.0</javadoc-plugin.version>
        <gpg-plugin.version>3.0.1</gpg-plugin.version>

        <!-- Sonar -->
        <sonar.coverage.exclusions>
            **/model*/**/*.*,**/resources/**/*.*,**/JaxRsActivator*
        </sonar.coverage.exclusions>
<!--        <sonar.exclusions></sonar.exclusions>-->

        <!-- Other -->
        <projectlombok.version>1.18.26</projectlombok.version>
        <projectlombok.mapstruct-binding.version>0.2.0</projectlombok.mapstruct-binding.version>
        <mapstruct.version>1.5.5.Final</mapstruct.version>
        <mockito.version>5.3.0</mockito.version>
        
        <assertj.version>3.24.2</assertj.version>
        <hibernate-orm.version>5.4.27.SP1</hibernate-orm.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>io.quarkus</groupId>
                <artifactId>quarkus-bom</artifactId>
                <version>${quarkus.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.tkit.quarkus.lib</groupId>
                <artifactId>tkit-quarkus-bom</artifactId>
                <version>${tkit.quarkus.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>${projectlombok.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.mapstruct</groupId>
                <artifactId>mapstruct</artifactId>
                <version>${mapstruct.version}</version>
                <type>jar</type>
            </dependency>
            <dependency>
                <groupId>io.quarkiverse.openapi.generator</groupId>
                <artifactId>quarkus-openapi-generator</artifactId>
                <version>${quarkiverse.quarkus-openapi-generator.version}</version>
            </dependency>
            <dependency>
                <groupId>io.quarkiverse.mockserver</groupId>
                <artifactId>quarkus-mockserver</artifactId>
                <version>${quarkiverse.mockserver.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>io.quarkiverse.mockserver</groupId>
                <artifactId>quarkus-mockserver-test</artifactId>
                <version>${quarkiverse.mockserver.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>${assertj.version}</version>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito.version}</version>
                <scope>test</scope>
            </dependency>

        </dependencies>
    </dependencyManagement>

    <dependencies>


        <!-- Build -->
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-container-image-docker</artifactId>
        </dependency>

        <!-- Test -->
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-junit5</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>rest-assured</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.awaitility</groupId>
            <artifactId>awaitility</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-jacoco</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>io.smallrye</groupId>
                    <artifactId>smallrye-open-api-maven-plugin</artifactId>
                    <version>${quarkus.smallrye-open-api.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>io.quarkus</groupId>
                <artifactId>quarkus-maven-plugin</artifactId>
                <version>${quarkus.version}</version>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <goals>
                            <goal>build</goal>
                            <goal>generate-code</goal>
                            <goal>generate-code-tests</goal>
                        </goals>
                        <configuration>
                            <properties>
                                <quarkus.container-image.build>true</quarkus.container-image.build>
                                <quarkus.container-image.group>localhost</quarkus.container-image.group>
                            </properties>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven.compiler-plugin.version}</version>
                <configuration>
                    <compilerArgs>
                        <arg>-parameters</arg>
                        <arg>-Amapstruct.defaultComponentModel=cdi</arg>
                        <arg>-Amapstruct.defaultInjectionStrategy=constructor</arg>
                    </compilerArgs>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>org.mapstruct</groupId>
                            <artifactId>mapstruct-processor</artifactId>
                            <version>${mapstruct.version}</version>
                        </path>
                        <path>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                            <version>${projectlombok.version}</version>
                        </path>
                        <path>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok-mapstruct-binding</artifactId>
                            <version>${projectlombok.mapstruct-binding.version}</version>
                        </path>
                        <path>
                            <groupId>org.hibernate</groupId>
                            <artifactId>hibernate-jpamodelgen</artifactId>
                            <version>${hibernate-orm.version}</version>
                        </path>
                    </annotationProcessorPaths>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven.surefire-plugin.version}</version>
                <configuration>
                    <systemPropertyVariables>
                        <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
                        <!--suppress UnresolvedMavenProperty -->
                        <maven.home>${maven.home}</maven.home>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>${maven.surefire-plugin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                        <configuration>
                            <systemPropertyVariables>
                                <native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
                                <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
                                <!--suppress UnresolvedMavenProperty -->
                                <maven.home>${maven.home}</maven.home>
                            </systemPropertyVariables>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>net.revelc.code.formatter</groupId>
                <artifactId>formatter-maven-plugin</artifactId>
                <version>${maven.formatter-plugin.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>io.quarkus</groupId>
                        <artifactId>quarkus-ide-config</artifactId>
                        <version>${quarkus.version}</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <configFile>eclipse-format.xml</configFile>
                    <lineEnding>LF</lineEnding>
                    <skip>${format.skip}</skip>
                </configuration>
            </plugin>
            <plugin>
                <groupId>net.revelc.code</groupId>
                <artifactId>impsort-maven-plugin</artifactId>
                <version>${maven.impsort-plugin.version}</version>
                <configuration>
                    <groups>java.,javax.,jakarta.,org.,com.</groups>
                    <staticGroups>*</staticGroups>
                    <skip>${format.skip}</skip>
                    <removeUnused>true</removeUnused>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>${maven.enforcer-plugin.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>io.quarkus</groupId>
                        <artifactId>quarkus-enforcer-rules</artifactId>
                        <version>${quarkus.version}</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>enforce</id>
                        <configuration>
                            <rules>
                                <dependencyConvergence/>
                                <externalRules>
                                    <location>classpath:enforcer-rules/quarkus-require-java-version.xml</location>
                                </externalRules>
                                <externalRules>
                                    <location>classpath:enforcer-rules/quarkus-require-maven-version.xml</location>
                                </externalRules>
                                <bannedDependencies>
                                    <!-- Copy and paste from quarkus and disable transitive checks -->
                                    <!-- Source: classpath:enforcer-rules/quarkus-banned-dependencies.xml -->
                                    <searchTransitive>false</searchTransitive>
                                    <excludes>
                                        <!-- Use Jakarta artifacts instead of JBoss specific ones -->
                                        <exclude>org.jboss.spec.javax.annotation:jboss-annotations-api_1.2_spec</exclude>
                                        <exclude>org.jboss.spec.javax.annotation:jboss-annotations-api_1.3_spec</exclude>
                                        <exclude>org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec</exclude>
                                        <exclude>org.jboss.spec.javax.transaction:jboss-transaction-api_1.3_spec</exclude>
                                        <exclude>org.jboss.spec.javax.servlet:jboss-servlet-api_4.0_spec</exclude>
                                        <exclude>org.jboss.spec.javax.security.jacc:jboss-jacc-api_1.5_spec</exclude>
                                        <exclude>org.jboss.spec.javax.security.auth.message:jboss-jaspi-api_1.1_spec</exclude>
                                        <exclude>org.jboss.spec.javax.websocket:jboss-websocket-api_1.1_spec</exclude>
                                        <exclude>org.jboss.spec.javax.interceptor:jboss-interceptors-api_1.2_spec</exclude>
                                        <exclude>org.jboss.spec.javax.el:jboss-el-api_3.0_spec</exclude>
                                        <!-- except for these 2 for now as most of the RESTEasy optional artifacts depend on them
                                        <exclude>org.jboss.spec.javax.ws.rs:jboss-jaxrs-api_2.1_spec</exclude>
                                        <exclude>org.jboss.spec.javax.xml.bind:jboss-jaxb-api_2.3_spec</exclude>
                                        -->
                                        <exclude>org.jboss.spec.javax.xml.bind:jboss-jaxb-api_2.3_spec</exclude>
                                        <exclude>org.jboss.spec.javax.ws.rs:jboss-jaxrs-api_3.0_spec</exclude>
                                        <exclude>org.jboss.spec.javax.ws.rs:jboss-jaxrs-api_2.1_spec</exclude>
                                        <!-- Exclude javax dependencies in favor of Jakarta -->
                                        <exclude>javax.activation:activation</exclude>
                                        <exclude>javax.activation:javax.activation-api</exclude>
                                        <!-- we allow javax.annotation-api for Maven -->
                                        <exclude>javax.enterprise:cdi-api</exclude>
                                        <!-- we allow javax.inject for Maven -->
                                        <exclude>javax.json:javax.json-api</exclude>
                                        <exclude>javax.json.bind:javax.json.bind-api</exclude>
                                        <exclude>org.glassfish:javax.json</exclude>
                                        <exclude>org.glassfish:javax.el</exclude>
                                        <exclude>org.glassfish:jakarta.el</exclude>
                                        <exclude>javax.persistence:javax.persistence-api</exclude>
                                        <exclude>javax.persistence:persistence-api</exclude>
                                        <exclude>javax.security.enterprise:javax.security.enterprise-api</exclude>
                                        <exclude>javax.servlet:servlet-api</exclude>
                                        <exclude>javax.servlet:javax.servlet-api</exclude>
                                        <exclude>javax.transaction:jta</exclude>
                                        <exclude>javax.transaction:javax.transaction-api</exclude>
                                        <exclude>javax.validation:validation-api</exclude>
                                        <exclude>javax.xml.bind:jaxb-api</exclude>
                                        <exclude>javax.websocket:javax.websocket-api</exclude>
                                        <exclude>javax.ws.rs:javax.ws.rs-api</exclude>
                                        <!-- Exclude com.sun.activation:jakarta.activation as we switched to Angus Activation -->
                                        <exclude>com.sun.activation:jakarta.activation</exclude>
                                        <!-- use our jboss-logmanager -->
                                        <exclude>org.jboss.logging:jboss-logmanager</exclude>
                                        <exclude>org.jboss.logging:jboss-logging-jdk</exclude>
                                        <!-- We don't want all the API's in one jar-->
                                        <exclude>javax:javaee-api</exclude>
                                        <!-- Prevent incompatible config from coming in -->
                                        <exclude>org.wildfly.client:wildfly-client-config</exclude>
                                        <exclude>org.jboss.marshalling:jboss-marshalling-osgi</exclude>
                                        <exclude>org.jboss.spec.javax.servlet:jboss-servlet-api_3.1_spec</exclude>
                                        <exclude>org.glassfish:jakarta.json</exclude>
                                        <exclude>org.eclipse.parsson:jakarta.json</exclude>
                                        <!-- Ensure none of the deps use netty-all. This forces deps to use more fine grained netty artifacts -->
                                        <exclude>io.netty:netty-all</exclude>
                                        <!-- Ban jboss-logmanager, we use jboss-logmanager-embedded -->
                                        <exclude>org.jboss.logmanager:jboss-logmanager</exclude>
                                        <!-- Ban Log4J (use org.jboss.logmanager:log4j-jboss-logmanager instead) -->
                                        <exclude>log4j:log4j</exclude>
                                        <exclude>org.apache.logging.log4j:log4j-core</exclude>
                                        <exclude>org.apache.logging.log4j:log4j-slf4j-impl</exclude>
                                        <!-- Ban commons-logging (use org.jboss.logging:commons-logging-jboss-logging instead) -->
                                        <exclude>commons-logging:commons-logging</exclude>
                                        <exclude>commons-logging:commons-logging-api</exclude>
                                        <exclude>org.springframework:spring-jcl</exclude>
                                        <exclude>org.slf4j:jcl-over-slf4j</exclude>
                                        <!-- Ban SLF4j implementations (use org.jboss.slf4j:slf4j-jboss-logmanager instead) -->
                                        <exclude>org.jboss.slf4j:slf4j-jboss-logging</exclude>
                                        <exclude>org.slf4j:slf4j-simple</exclude>
                                        <exclude>org.slf4j:slf4j-nop</exclude>
                                        <exclude>org.slf4j:slf4j-jdk14</exclude>
                                        <exclude>org.slf4j:slf4j-log4j12</exclude>
                                        <exclude>org.slf4j:slf4j-log4j13</exclude>
                                        <!-- Ban Logback implementations -->
                                        <exclude>ch.qos.logback:logback-classic</exclude>
                                        <exclude>ch.qos.logback:logback-core</exclude>
                                        <exclude>ch.qos.logback:logback-access</exclude>
                                        <exclude>ch.qos.logback:logback</exclude>
                                        <exclude>org.osgi:org.osgi.annotation.versioning</exclude>
                                        <!-- Ban Spring Dependencies (since we have our own jars)-->
                                        <exclude>org.springframework:spring-core</exclude>
                                        <exclude>org.springframework:spring-beans</exclude>
                                        <exclude>org.springframework:spring-context</exclude>
                                        <exclude>org.springframework:spring-web</exclude>
                                        <exclude>org.springframework:spring-webmvc</exclude>
                                        <exclude>org.springframework.data:spring-data-jpa</exclude>
                                        <exclude>org.springframework.data:spring-data-commons</exclude>
                                        <exclude>org.springframework.security:spring-security-core</exclude>
                                        <exclude>org.springframework.boot:spring-boot</exclude>
                                        <!-- Ban checker-qual, we don't use Checker Framework -->
                                        <exclude>org.checkerframework:checker-qual</exclude>
                                        <!-- We use our own impl here, including this one causes problems-->
                                        <exclude>org.jboss.resteasy:resteasy-context-propagation</exclude>
                                        <exclude>com.google.android:annotations</exclude>
                                        <exclude>org.codehaus.mojo:animal-sniffer-annotations</exclude>
                                        <!-- Includes its own copy of an old version of the servlet API-->
                                        <exclude>org.apache.tomcat.embed:tomcat-embed-core</exclude>
                                        <exclude>org.jboss.modules:jboss-modules</exclude>
                                        <!-- We prefer ByteBuddy where possible
                                             but Protostream requires Javassist and moving away from it will be hard)-->
                                        <!--<exclude>org.javassist:javassist</exclude>-->
                                        <!-- Jandex moved to SmallRye -->
                                        <exclude>org.jboss:jandex</exclude>
                                        <!-- Ensure Fabric8 Kubernetes Client won't propagate its OkHttp implementation -->
                                        <exclude>io.fabric8:kubernetes-httpclient-okhttp</exclude>
                                    </excludes>
                                    <includes>
                                        <!-- this is for REST Assured -->
                                        <include>jakarta.xml.bind:jakarta.xml.bind-api:*:*:test</include>
                                    </includes>
                                </bannedDependencies>
                            </rules>
                        </configuration>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>enforce-banned-deps</id>
                        <configuration>
                            <rules>
                                <bannedDependencies>
                                    <excludes>
                                        <exclude>io.quarkus:quarkus-config-yaml</exclude>
                                        <exclude>junit:junit</exclude>
                                        <exclude>commons-lang:commons-lang</exclude>
                                        <exclude>commons-collections:commons-collections</exclude>
                                        <exclude>org.apache.commons:commons-lang3</exclude>
                                        <exclude>org.apache.commons:commons-text</exclude>
                                        <exclude>com.google.code.gson:gson</exclude>
                                        <exclude>com.google.guava:guava</exclude>
                                        <exclude>com.squareup.okhttp3:*</exclude>
                                        <exclude>com.alibaba:*</exclude>
                                        <exclude>org.glassfish:*</exclude>
                                        <exclude>org.jboss.resteasy:*</exclude>
                                        <exclude>io.swagger:*</exclude>
                                        <exclude>io.swagger.core.v3:*</exclude>
                                        <exclude>io.specto:hoverfly-java</exclude>
                                        <exclude>org.mockito:mockito-junit-jupiter</exclude>
                                        <exclude>commons-validator:commons-validator</exclude>
                                    </excludes>
                                    <message>Found banned dependencies</message>
                                    <searchTransitive>false</searchTransitive>
                                </bannedDependencies>
                            </rules>
                            <skip>${enforce-test-deps-scope.skip}</skip>
                        </configuration>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>enforce-test-deps-scope</id>
                        <configuration>
                            <rules>
                                <bannedDependencies>
                                    <excludes>
                                        <exclude>io.quarkus:quarkus-test-*</exclude>
                                        <exclude>io.rest-assured:*</exclude>
                                        <exclude>org.assertj:*</exclude>
                                    </excludes>
                                    <includes>
                                        <include>io.quarkus:quarkus-test-*:*:*:test</include>
                                        <include>io.rest-assured:*:*:*:test</include>
                                        <include>org.assertj:*:*:*:test</include>
                                    </includes>
                                    <message>Found test dependencies with wrong scope:</message>
                                </bannedDependencies>
                            </rules>
                            <skip>${enforce-test-deps-scope.skip}</skip>
                        </configuration>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>enforce-test-deps-junit-scope</id>
                        <configuration>
                            <rules>
                                <bannedDependencies>
                                    <searchTransitive>false</searchTransitive>
                                    <excludes>
                                        <exclude>org.junit.jupiter:*</exclude>
                                    </excludes>
                                    <includes>
                                        <include>org.junit.jupiter:*:*:*:test</include>
                                    </includes>
                                    <message>Found JUnit dependencies with wrong scope:</message>
                                </bannedDependencies>
                            </rules>
                            <skip>${enforce-test-deps-scope.skip}</skip>
                        </configuration>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <!-- Profiles -->
    <profiles>
        <profile>
            <id>native</id>
            <activation>
                <property>
                    <name>native</name>
                </property>
            </activation>
            <properties>
                <skipITs>false</skipITs>
                <quarkus.package.type>native</quarkus.package.type>
            </properties>
        </profile>
        <profile>
            <id>openapi</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>io.smallrye</groupId>
                        <artifactId>smallrye-open-api-maven-plugin</artifactId>                        
                        <version>${quarkus.smallrye-open-api.version}</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>generate-schema</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>format</id>
            <activation>
                <activeByDefault>true</activeByDefault>
                <property>
                    <name>!no-format</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>net.revelc.code.formatter</groupId>
                        <artifactId>formatter-maven-plugin</artifactId>
                        <version>${maven.formatter-plugin.version}</version>
                        <executions>
                            <execution>
                                <phase>process-sources</phase>
                                <goals>
                                    <goal>format</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>net.revelc.code</groupId>
                        <artifactId>impsort-maven-plugin</artifactId>
                        <version>${maven.impsort-plugin.version}</version>
                        <configuration>
                            <removeUnused>true</removeUnused>
                        </configuration>
                        <executions>
                            <execution>
                                <id>sort-imports</id>
                                <goals>
                                    <goal>sort</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>validate</id>
            <activation>
                <activeByDefault>true</activeByDefault>
                <property>
                    <name>no-format</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>net.revelc.code.formatter</groupId>
                        <artifactId>formatter-maven-plugin</artifactId>
                        <version>${maven.formatter-plugin.version}</version>
                        <executions>
                            <execution>
                                <phase>process-sources</phase>
                                <goals>
                                    <goal>validate</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>net.revelc.code</groupId>
                        <artifactId>impsort-maven-plugin</artifactId>
                        <version>${maven.impsort-plugin.version}</version>
                        <configuration>
                            <removeUnused>true</removeUnused>
                        </configuration>
                        <executions>
                            <execution>
                                <id>check-imports</id>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>release</id>
            <activation>
                <property>
                    <name>release</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <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://s01.oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                            <stagingProgressTimeoutMinutes>60</stagingProgressTimeoutMinutes>
                        </configuration>
                    </plugin>
                    <!-- Generate source code artifact -->
                    <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>
                    <!-- Generate javadoc artifact -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${javadoc-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- Sign artifacts before upload -->
                    <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>
                                <configuration>
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

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

</project>
