<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.github.nfalco79</groupId>
    <artifactId>parent</artifactId>
    <version>1.0.0-beta1</version>
    <packaging>pom</packaging>
    <name>Organisation Parent pom.xml</name>
    <description>A Maven parent pom where define common lifecycle for these projects</description>
    <url>https://github.com/nfalco79/parent-pom</url>
    <licenses>
        <license>
            <name>Apache 2</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>nfalco79</id>
            <name>Nikolas Falco</name>
        </developer>
    </developers>
    <issueManagement>
        <system>github</system>
        <url>https://github.com/nfalco79/parent-pom/issues</url>
    </issueManagement>
    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <scm>
        <url>https://github.com/nfalco79/parent-pom</url>
        <connection>scm:git:git@github.com:nfalco79/parent-pom.git</connection>
        <developerConnection>scm:git:git@github.com:nfalco79/parent-pom.git</developerConnection>
        <tag>1.0.0-beta1</tag>
    </scm>

    <properties>
        <java.level>you-must-override-the-java.level-property</java.level>
        <!-- Change this property if you need your tests to be compiled with a different Java level than the plugin. -->
        <!-- Use only if strictly necessary. It may cause problems in your IDE. -->
        <java.level.test>${java.level}</java.level.test>
        <!-- Whether to skip tests during release phase (they are executed in the prepare phase). -->

        <!-- default plugin's version -->
        <maven-coveralls-plugin.version>4.3.0</maven-coveralls-plugin.version>
        <maven-sonar-packaging-plugin.version>1.21.0.505</maven-sonar-packaging-plugin.version>
        <maven-deployer-extension.version>0.3.0</maven-deployer-extension.version>
        <maven-docker-plugin.version>0.37.0</maven-docker-plugin.version>
        <maven-dependency-plugin.version>3.2.0</maven-dependency-plugin.version>
        <maven-site-plugin.version>3.9.1</maven-site-plugin.version>
        <maven-reports-plugin.version>3.2.1</maven-reports-plugin.version>
        <maven-javadoc-plugin.version>3.3.1</maven-javadoc-plugin.version>
        <maven-scm-plugin.version>1.11.3</maven-scm-plugin.version>
        <maven-release-plugin.version>3.0.0-M5</maven-release-plugin.version>
        <maven-shade-plugin.version>3.2.4</maven-shade-plugin.version>
        <maven-compiler-plugin.version>3.10.0</maven-compiler-plugin.version>
        <maven-jar-plugin.version>3.2.0</maven-jar-plugin.version>
        <maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
        <maven-source-plugin.version>3.2.0</maven-source-plugin.version>
        <maven-assembly-plugin.version>3.3.0</maven-assembly-plugin.version>
        <maven-antrun-plugin.version>3.0.0</maven-antrun-plugin.version>
        <maven-enforcer-plugin.version>3.0.0-M3</maven-enforcer-plugin.version>
        <maven-surefire-plugin.version>3.0.0-M5</maven-surefire-plugin.version>
        <maven-wagon-plugin.version>3.4.3</maven-wagon-plugin.version>
        <maven-helper-plugin.version>3.2.0</maven-helper-plugin.version>
        <maven-install-plugin.version>3.0.0-M1</maven-install-plugin.version>
        <maven-deploy-plugin.version>3.0.0-M1</maven-deploy-plugin.version>
        <maven-bnd-plugin.version>6.1.0</maven-bnd-plugin.version>
        <maven-jacoco-plugin.version>0.8.7</maven-jacoco-plugin.version>
        <maven-checkstyle-plugin.version>3.1.2</maven-checkstyle-plugin.version>
        <checkstyle.version>8.45.1</checkstyle.version>
        <smartics-enforcer-rules.version>1.0.2</smartics-enforcer-rules.version>

        <!-- default project's settings -->
        <maven.compiler.target>1.${java.level}</maven.compiler.target>
        <maven.compiler.source>1.${java.level}</maven.compiler.source>
        <project.build.sourceEncoding>UTF8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <skip-javadoc>false</skip-javadoc>
        <skip-sources>false</skip-sources>
        <skipTests>false</skipTests>

        <!-- sonarcloud settings -->
        <sonar.organization>nfalco79</sonar.organization>
        <sonar.host.url>https://sonarcloud.io</sonar.host.url>

        <releaseProfiles>release</releaseProfiles>

        <!-- default dependency's version -->
        <mockito.version>4.3.1</mockito.version>
        <assertj.version>3.22.0</assertj.version>
        <junit.version>4.13.2</junit.version>
    </properties>

    <dependencies>
        <!-- unit tests -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>${assertj.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <reporting>
        <plugins>
            <!-- Add the Maven project information reports -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>index</report>
                            <report>issue-management</report>
                            <report>ci-management</report>
                            <report>licenses</report>
                            <report>scm</report>
                            <report>summary</report>
                            <report>dependencies</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    </reporting>

    <build>
        <defaultGoal>install</defaultGoal>
        <extensions>
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-ssh</artifactId>
                <version>${maven-wagon-plugin.version}</version>
            </extension>
            <extension>
                <groupId>com.soebes.maven.extensions</groupId>
                <artifactId>maven-deployer-extension</artifactId>
                <version>${maven-deployer-extension.version}</version>
            </extension>
        </extensions>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId>
                    <artifactId>sonar-packaging-maven-plugin</artifactId>
                    <version>${maven-sonar-packaging-plugin.version}</version>
                    <extensions>true</extensions>
                </plugin>
                <plugin>
                    <groupId>io.fabric8</groupId>
                    <artifactId>docker-maven-plugin</artifactId>
                    <version>${maven-docker-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>biz.aQute.bnd</groupId>
                    <artifactId>bnd-maven-plugin</artifactId>
                    <version>${maven-bnd-plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>${maven-shade-plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${maven-jar-plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>${maven-dependency-plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>${maven-enforcer-plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                    <configuration>
                        <source>1.${java.level}</source>
                        <target>1.${java.level}</target>
                        <testSource>1.${java.level.test}</testSource>
                        <testTarget>1.${java.level.test}</testTarget>
                        <!-- https://issues.apache.org/jira/browse/MCOMPILER-209 -->
                        <useIncrementalCompilation>false</useIncrementalCompilation>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>${maven-assembly-plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${maven-source-plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven-javadoc-plugin.version}</version>
                    <configuration>
                        <quiet>true</quiet>
                        <notimestamp>true</notimestamp>
                        <doctitle>${project.name} ${project.version}</doctitle>
                        <excludePackageNames>*.internal,*.internal.*</excludePackageNames>
                        <source>${java.level}</source>
                        <tags>
                            <tag>
                                <name>generated</name>
                                <placement>a</placement>
                                <head>Generated code</head>
                            </tag>
                            <tag>
                                <name>NOSONAR</name>
                                <placement>X</placement>
                            </tag>
                            <tag>
                                <name>noextend</name>
                                <placement>t</placement>
                                <head>Other bundles must not extend this class.</head>
                            </tag>
                            <tag>
                                <name>noimplement</name>
                                <placement>t</placement>
                                <head>Other bundles must not extend this interface.</head>
                            </tag>
                        </tags>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>${maven-install-plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>${maven-deploy-plugin.version}</version>
                    <configuration>
                        <retryFailedDeploymentCount>3</retryFailedDeploymentCount>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>${maven-release-plugin.version}</version>
                    <configuration>
                        <indentSize>4</indentSize>
                        <tagNameFormat>@{project.version}</tagNameFormat>
                        <preparationGoals>clean install</preparationGoals>
                        <releaseProfiles>release</releaseProfiles>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-project-info-reports-plugin</artifactId>
                    <version>${maven-reports-plugin.version}</version>
                    <configuration>
                        <dependencyDetailsEnabled>false</dependencyDetailsEnabled>
                        <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>${maven-site-plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                    <configuration>
                        <rerunFailingTestsCount>2</rerunFailingTestsCount>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>${maven-gpg-plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>${maven-antrun-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>${maven-helper-plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>${maven-checkstyle-plugin.version}</version>
                    <configuration>
                        <resourceIncludes>**/*.properties,**/*.xml</resourceIncludes>
                        <includeTestSourceDirectory>true</includeTestSourceDirectory>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>com.puppycrawl.tools</groupId>
                            <artifactId>checkstyle</artifactId>
                            <version>${checkstyle.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${maven-jacoco-plugin.version}</version>
                    <configuration>
                        <excludes>
                            <exclude>**/*NLS.class</exclude>
                            <exclude>**/*DTO.class</exclude>
                            <exclude>**/*Dto.class</exclude>
                            <exclude>**/*Bean.class</exclude>
                            <exclude>**/*Consts.class</exclude>
                            <exclude>**/*Constants.class</exclude>
                        </excludes>
                        <formats>
                            <format>XML</format>
                        </formats>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.eluder.coveralls</groupId>
                    <artifactId>coveralls-maven-plugin</artifactId>
                    <version>${maven-coveralls-plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>io.fabric8</groupId>
                <artifactId>docker-maven-plugin</artifactId>
                <extensions>true</extensions>
            </plugin>
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                        <configuration>
                            <skipSource>${skip-sources}</skipSource>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <skip>${skip-javadoc}</skip>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>enforce-build</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>[3.3.9,)</version>
                                    <message>3.3.9 is required at least.</message>
                                </requireMavenVersion>
                                <requireJavaVersion>
                                    <version>[1.${java.level}.0,]</version>
                                </requireJavaVersion>
                                <reactorModuleConvergence>
                                    <message>The reactor is not valid</message>
                                    <ignoreModuleDependencies>true</ignoreModuleDependencies>
                                </reactorModuleConvergence>
                                <requireReleaseDeps>
                                    <message>No Snapshots Allowed!</message>
                                    <onlyWhenRelease>true</onlyWhenRelease>
                                </requireReleaseDeps>
                                <NoSnapshotDependenciesInDependencyManagementRule implementation="de.smartics.maven.enforcer.rule.NoSnapshotsInDependencyManagementRule">
                                    <onlyWhenRelease>true</onlyWhenRelease>
                                    <checkOnlyResolvedDependencies>false</checkOnlyResolvedDependencies>
                                </NoSnapshotDependenciesInDependencyManagementRule>
                                <requireUpperBoundDeps />
                            </rules>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>de.smartics.rules</groupId>
                        <artifactId>smartics-enforcer-rules</artifactId>
                        <version>${smartics-enforcer-rules.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>coveralls</id>
            <activation>
                <property>
                    <name>env.COVERALLS_REPO_TOKEN</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>report</id>
                                <phase>test</phase>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.eluder.coveralls</groupId>
                        <artifactId>coveralls-maven-plugin</artifactId>
                        <configuration>
                            <repoToken>${env.COVERALLS_REPO_TOKEN}</repoToken>
                        </configuration>
                        <dependencies>
                            <!-- required to work on JDK 11 -->
                            <dependency>
                                <groupId>com.sun.xml.bind</groupId>
                                <artifactId>jaxb-impl</artifactId>
                                <version>2.3.5</version>
                            </dependency>
                        </dependencies>
                        <executions>
                            <execution>
                                <phase>test</phase>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <!-- used for local maven release build -->
                    <plugin>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>