<?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>io.github.java-helpers</groupId>
  <artifactId>simple-builders-core</artifactId>
  <version>0.3.0</version>

  <packaging>jar</packaging>

  <name>Simple Builders - Core</name>
  <description>API components for result Simple Builders, needs to be a dependency of using project to have access to annotations and default builders.</description>
  <url>https://github.com/java-helpers/simple-builders/</url>
  <inceptionYear>2025</inceptionYear>

  <licenses>
    <license>
      <name>MIT License</name>
      <url>http://www.opensource.org/licenses/mit-license.php</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <scm>
    <connection>scm:git:git://github.com/java-helpers/simple-builders.git</connection>
    <developerConnection>scm:git:ssh://github.com/java-helpers/simple-builders.git</developerConnection>
    <url>https://github.com/java-helpers/simple-builders/tree/main</url>
    <tag>HEAD</tag>
  </scm>

  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/java-helpers/simple-builders/issues</url>
  </issueManagement>

  <ciManagement>
    <system>Github Actions</system>
    <url>https://github.com/java-helpers/simple-builders/actions</url>
  </ciManagement>

  <developers>
    <developer>
      <name>Andreas Igel</name>
      <id>aigel</id>
      <email>Andreas.Igel@gmx.com</email>
      <roles>
        <role>Java Developer</role>
        <role>Java Architect</role>
      </roles>
    </developer>
  </developers>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    <!-- Java and Compiler Properties -->
    <java.version>17</java.version>
    <maven.compiler.source>${java.version}</maven.compiler.source>
    <maven.compiler.target>${java.version}</maven.compiler.target>
    <maven.compiler.release>${java.version}</maven.compiler.release>
    
    <!-- Maven Central Publishing -->
    <central.autoPublish>false</central.autoPublish>
    
    <!-- Dependency Versions -->
    <junit-jupiter.version>6.0.3</junit-jupiter.version>
    <apache-commons-lang3.version>3.20.0</apache-commons-lang3.version>
    
    <!-- Plugin Versions -->
    <plugin.central.publishing.version>0.10.0</plugin.central.publishing.version>
    <plugin.code-format.version>2.29</plugin.code-format.version>
    <plugin.maven.compiler.version>3.15.0</plugin.maven.compiler.version>
    <plugin.maven.source.version>3.4.0</plugin.maven.source.version>
    <plugin.maven.javadoc.version>3.12.0</plugin.maven.javadoc.version>
    <plugin.maven.gpg.version>3.2.8</plugin.maven.gpg.version>
    <plugin.maven.install.version>3.1.4</plugin.maven.install.version>
    <plugin.maven.site.version>3.21.0</plugin.maven.site.version>
    <plugin.jacoco.version>0.8.14</plugin.jacoco.version>
  </properties>

  <dependencies>
    <!-- Apache Commons Lang for ToStringBuilder -->
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>${apache-commons-lang3.version}</version>
    </dependency>
    
    <!-- Test Dependencies -->
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <version>${junit-jupiter.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <version>${junit-jupiter.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <!-- Code Formatting -->
      <plugin>
        <groupId>com.spotify.fmt</groupId>
        <artifactId>fmt-maven-plugin</artifactId>
        <version>${plugin.code-format.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>format</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- Compiler Plugin -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${plugin.maven.compiler.version}</version>
      </plugin>
      
      <!-- Site Plugin -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>${plugin.maven.site.version}</version>
      </plugin>
      
      <!-- Install Plugin -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-install-plugin</artifactId>
        <version>${plugin.maven.install.version}</version>
      </plugin>
    </plugins>
  </build>

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

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.sonatype.central</groupId>
            <artifactId>central-publishing-maven-plugin</artifactId>
            <version>${plugin.central.publishing.version}</version>
            <extensions>true</extensions>
            <configuration>
              <publishingServerId>central</publishingServerId>
              <autoPublish>${central.autoPublish}</autoPublish>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>${plugin.maven.source.version}</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          
          <!-- JavaDoc Generation -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${plugin.maven.javadoc.version}</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <doclint>none</doclint>
              <source>${java.version}</source>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>${plugin.maven.gpg.version}</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <gpgArguments>
                <arg>--pinentry-mode</arg>
                <arg>loopback</arg>
              </gpgArguments>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>metrics</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>${plugin.jacoco.version}</version>
            <executions>
              <execution>
                <id>prepare-agent</id>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
              </execution>
              <execution>
                <id>report</id>
                <phase>verify</phase>
                <goals>
                  <goal>report</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <dataFile>${project.build.directory}/jacoco.exec</dataFile>
              <outputDirectory>${project.reporting.outputDirectory}/jacoco</outputDirectory>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>