<?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>be.sddevelopment.commons</groupId>
  <artifactId>code-utils</artifactId>
  <version>1.0.1</version>
  <packaging>pom</packaging>

  <description>
    A set of tools and utility classes, aimed at making it easier for developers to write their code
    in a clean and concise manner.
    These utilities will mostly be generic implementations that provide a quicker way to implement
    useful design patterns.
  </description>

  <organization>
    <name>SD Development</name>
    <url>https://www.sddevelopment.be</url>
  </organization>

  <developers>
    <developer>
      <name>Stijn Dejongh</name>
      <organization>SD Development</organization>
      <organizationUrl>http://www.sddevelopment.be</organizationUrl>
      <roles>
        <role>Project maintainer</role>
      </roles>
    </developer>
  </developers>

  <modules>
    <module>commons</module>
    <module>commons-testing</module>
    <module>commons-kernel</module>
  </modules>

  <distributionManagement>
    <repository>
      <id>github</id>
      <name>GitHub SDDevelopment Apache Maven Packages</name>
      <url>https://maven.pkg.github.com/sddevelopment-be/coding-utils</url>
    </repository>
  </distributionManagement>

  <url>https://github.com/sddevelopment-be/coding-utils</url>
  <licenses>
    <license>
      <name>EUPL v.1.2</name>
      <url>https://github.com/sddevelopment-be/coding-utils/blob/main/LICENSE</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <scm>
    <connection>scm:git:ssh://git@github.com/sddevelopment-be/coding-utils.git</connection>
    <url>${project.url}</url>
    <tag>code-utils-1.0.1</tag>
  </scm>



  <properties>
    <sonar.organization>sddevelopment-be</sonar.organization>
    <sonar.host.url>https://sonarcloud.io</sonar.host.url>
    <sonar.projectKey>sddevelopment-be_coding-utils</sonar.projectKey>
    <sonar.coverage.jacoco.xmlReportPaths>${jacoco.build.dir}/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
    <jacoco.build.dir>${project.build.directory}/jacoco</jacoco.build.dir>
    <sonar.coverage.exclusions>**/*.html</sonar.coverage.exclusions>
    <sonar.cpd.exclusions>**/*.html</sonar.cpd.exclusions>

    <java.version>21</java.version>
    <archunit.version>1.3.0</archunit.version>
    <junit.jupiter.version>5.11.0</junit.jupiter.version>
    <assertj.version>3.26.3</assertj.version>

    <lombok.version>1.18.32</lombok.version>
    <rewrite.version>5.36.0</rewrite.version>
  </properties>

  <dependencyManagement>
    <dependencies>

      <dependency>
        <groupId>be.sddevelopment.commons</groupId>
        <artifactId>commons</artifactId>
        <version>1.0.1</version>
      </dependency>
      <dependency>
        <groupId>be.sddevelopment.commons</groupId>
        <artifactId>commons-kernel</artifactId>
        <version>1.0.1</version>
      </dependency>
      <dependency>
        <groupId>be.sddevelopment.commons</groupId>
        <artifactId>commons-testing</artifactId>
        <version>1.0.1</version>
      </dependency>

      <!-- BEGIN UTIL SCOPE -->
      <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <version>${lombok.version}</version>
        <scope>compile</scope>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.15.0</version>
      </dependency>

      <!-- BEGIN TEST SCOPE -->
      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-engine</artifactId>
        <version>${junit.jupiter.version}</version>
      </dependency>
      <dependency>
        <groupId>org.assertj</groupId>
        <artifactId>assertj-core</artifactId>
        <version>${assertj.version}</version>
      </dependency>
      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-api</artifactId>
        <version>${junit.jupiter.version}</version>
      </dependency>
      <dependency>
        <groupId>com.tngtech.archunit</groupId>
        <artifactId>archunit-junit5-api</artifactId>
        <version>${archunit.version}</version>
      </dependency>
      <dependency>
        <groupId>com.tngtech.archunit</groupId>
        <artifactId>archunit-junit5-engine</artifactId>
        <version>${archunit.version}</version>
      </dependency>
      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-params</artifactId>
        <version>${junit.jupiter.version}</version>
      </dependency>
      <!-- END UTIL SCOPE -->
    </dependencies>
  </dependencyManagement>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.sonarsource.scanner.maven</groupId>
          <artifactId>sonar-maven-plugin</artifactId>
          <version>4.0.0.4121</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.13.0</version>
        <configuration>
          <source>${java.version}</source>
          <target>${java.version}</target>
          <encoding>UTF-8</encoding>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.6.3</version>
        <configuration>
          <stylesheet>maven</stylesheet>
          <javadocDirectory>commons/src/main/javadoc</javadocDirectory>
          <addStylesheets>
            <resources>/styles/stylesheet.css</resources>
          </addStylesheets>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok-maven-plugin</artifactId>
        <version>1.18.20.0</version>
        <configuration>
          <encoding>UTF-8</encoding>
          <sourceDirectory>commons/src/main/java</sourceDirectory>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.6.3</version>
        <configuration>
          <show>public</show>
          <nohelp>true</nohelp>
          <reportOutputDirectory>docs/javadoc</reportOutputDirectory>
          <destDir>.</destDir>
          <stylesheet>maven</stylesheet>
          <stylesheetfile>${project.basedir}/src/main/javadoc/stylesheet.css</stylesheetfile>
          <defaultVersion>${project.version}</defaultVersion>
          <sourcepath>${project.basedir}/target/generated-sources/delombok</sourcepath>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>2.0.0</version>
        <configuration>
          <verbose>false</verbose>
          <addSvnKeyWords>false</addSvnKeyWords>
          <organizationName>${project.organization.name}</organizationName>
          <inceptionYear>2020</inceptionYear>
          <emptyLineAfterHeader>true</emptyLineAfterHeader>
          <writeVersions>true</writeVersions>
          <addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
          <licenseName>eupl_v1_2</licenseName>
        </configuration>
        <executions>
          <execution>
            <id>first</id>
            <goals>
              <goal>update-file-header</goal>
            </goals>
            <phase>process-sources</phase>
            <configuration>
              <licenseName>eupl_v1_1</licenseName>
              <roots>
                <root>src/main/java</root>
                <root>src/test</root>
              </roots>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>3.1.2</version>
        <dependencies>
          <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${junit.jupiter.version}</version>
          </dependency>
        </dependencies>
      </plugin>

      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.8.12</version>
        <executions>
          <execution>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <!-- attached to Maven test phase -->
          <execution>
            <id>report</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>report</goal>
            </goals>
            <configuration>
              <dataFile>target/jacoco.exec</dataFile>
              <outputDirectory>target/jacoco</outputDirectory>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <excludes>
            <exclude>be/sddevelopment/commons/constants/**/*.class</exclude>
            <exclude>be/sddevelopment/commons/testing/conventions/**/*.class</exclude>
          </excludes>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.openrewrite.maven</groupId>
        <artifactId>rewrite-maven-plugin</artifactId>
        <version>${rewrite.version}</version>
        <configuration>
          <exportDatatables>true</exportDatatables>
          <activeRecipes>
            <recipe>org.openrewrite.java.testing.junit5.JUnit5BestPractices</recipe>
            <recipe>org.openrewrite.github.PreferTemurinDistributions</recipe>
            <recipe>org.openrewrite.staticanalysis.AnnotateNullableMethods</recipe>
            <recipe>org.openrewrite.staticanalysis.ChainStringBuilderAppendCalls</recipe>
            <recipe>org.openrewrite.staticanalysis.CompareEnumsWithEqualityOperator</recipe>
            <recipe>org.openrewrite.staticanalysis.ExplicitLambdaArgumentTypes</recipe>
            <recipe>org.openrewrite.staticanalysis.FixStringFormatExpressions</recipe>
            <recipe>org.openrewrite.staticanalysis.MissingOverrideAnnotation</recipe>
            <recipe>org.openrewrite.staticanalysis.ModifierOrder</recipe>
            <recipe>org.openrewrite.staticanalysis.NeedBraces</recipe>
            <recipe>org.openrewrite.staticanalysis.NoFinalizedLocalVariables</recipe>
            <recipe>org.openrewrite.staticanalysis.OperatorWrap</recipe>
            <recipe>org.openrewrite.staticanalysis.RemoveEmptyJavaDocParameters</recipe>
            <recipe>org.openrewrite.staticanalysis.RemoveExtraSemicolons</recipe>
            <recipe>org.openrewrite.staticanalysis.RenameLocalVariablesToCamelCase</recipe>
            <recipe>org.openrewrite.staticanalysis.SimplifyTernaryRecipes</recipe>
            <recipe>org.openrewrite.staticanalysis.UseSystemLineSeparator</recipe>
            <recipe>org.openrewrite.java.dependencies.DependencyVulnerabilityCheck</recipe>
            <recipe>org.openrewrite.recommendations.CodeStyle</recipe>
            <recipe>org.openrewrite.recommendations.DependencyManagement</recipe>
            <recipe>org.openrewrite.maven.OrderPomElements</recipe>
          </activeRecipes>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>org.openrewrite.recipe</groupId>
            <artifactId>rewrite-java-dependencies</artifactId>
            <version>1.23.0</version>
          </dependency>
          <dependency>
            <groupId>org.openrewrite.recipe</groupId>
            <artifactId>rewrite-testing-frameworks</artifactId>
            <version>2.22.0</version>
          </dependency>
          <dependency>
            <groupId>org.openrewrite.recipe</groupId>
            <artifactId>rewrite-github-actions</artifactId>
            <version>2.9.2</version>
          </dependency>
          <dependency>
            <groupId>org.openrewrite.recipe</groupId>
            <artifactId>rewrite-static-analysis</artifactId>
            <version>1.20.0</version>
          </dependency>
          <dependency>
            <groupId>org.openrewrite.recipe</groupId>
            <artifactId>rewrite-recommendations</artifactId>
            <version>1.13.0</version>
          </dependency>

        </dependencies>
      </plugin>
    </plugins>
  </build>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.6.3</version>
        <configuration>
          <reportOutputDirectory>docs/javadoc</reportOutputDirectory>
          <destDir>javadoc</destDir>
          <stylesheet>maven</stylesheet>
          <stylesheetfile>${project.basedir}/src/main/javadoc/stylesheet.css</stylesheetfile>
        </configuration>
        <reportSets>
          <reportSet>
            <id>aggregate</id>
            <inherited>false</inherited>
            <reports>
              <report>aggregate</report>
            </reports>
          </reportSet>
          <reportSet>
            <id>default</id>
            <reports>
              <report>javadoc</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
    </plugins>
  </reporting>

  <profiles>
    <profile>
      <id>publisher</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>3.2.7</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.6.3</version>
            <executions>
              <execution>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.3.1</version>
            <executions>
              <execution>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonatype.central</groupId>
            <artifactId>central-publishing-maven-plugin</artifactId>
            <version>0.6.0</version>
            <extensions>true</extensions>
            <configuration>
              <autoPublish>false</autoPublish>
              <deploymentName>${project.artifactId}:${project.version}</deploymentName>
              <waitUntil>validated</waitUntil>
              <publishingServerId>ossrh</publishingServerId>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <version>3.1.1</version>
            <configuration>
              <arguments>-ntp</arguments>
              <scmCommentPrefix />
              <tagNameFormat>v@{project.version}</tagNameFormat>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
