<?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.deathbycaptcha</groupId>
  <artifactId>deathbycaptcha-java-library</artifactId>
  <version>4.7.0</version>
  <packaging>jar</packaging>

  <name>DeathByCaptcha library for Java</name>
  <description>DeathByCaptcha Java library v4.7.0 (core client library artifact)</description>
  <url>https://github.com/deathbycaptcha/deathbycaptcha-api-client-java</url>

  <licenses>
    <license>
      <name>MIT License</name>
      <url>https://github.com/deathbycaptcha/deathbycaptcha-api-client-java/blob/main/LICENSE</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>DeathByCaptcha core developers</name>
      <email>deathbycaptcha@protonmail.com</email>
      <organization>DeathByCaptcha</organization>
      <organizationUrl>https://www.deathbycaptcha.com</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git://github.com/deathbycaptcha/deathbycaptcha-api-client-java.git</connection>
    <developerConnection>scm:git:git@github.com:deathbycaptcha/deathbycaptcha-api-client-java.git</developerConnection>
    <url>https://github.com/deathbycaptcha/deathbycaptcha-api-client-java/tree/main</url>
    <tag>HEAD</tag>
  </scm>



  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <java.release>21</java.release>
    <maven.compiler.source>${java.release}</maven.compiler.source>
    <maven.compiler.target>${java.release}</maven.compiler.target>
    <maven.compiler.release>${java.release}</maven.compiler.release>
    <selenium.version>4.2.1</selenium.version>
  </properties>

  <dependencies>
    <!-- Selenium WebDriver for browser automation -->
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>${selenium.version}</version>
        <optional>true</optional>
    </dependency>

    <!-- JUnit for testing (optional) -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.2</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <!-- Maven Compiler Plugin -->
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.13.0</version>
        <configuration>
          <release>${java.release}</release>
          <compilerArgs>
            <arg>-Xlint:deprecation</arg>
          </compilerArgs>
        </configuration>
      </plugin>

      <!-- Maven JAR Plugin -->
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.2.0</version>
      </plugin>

      <!-- Maven Javadoc Plugin -->
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.3.1</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <doclint>none</doclint>
          <additionalparam>-Xdoclint:none</additionalparam>
        </configuration>
      </plugin>

      <!-- Maven Source Plugin -->
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.2.1</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- Maven Surefire Plugin for tests -->
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.22.2</version>
      </plugin>

      <!-- Maven Clean Plugin -->
      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <version>3.1.0</version>
      </plugin>

      <!-- Maven Resources Plugin -->
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <version>3.2.0</version>
      </plugin>

      <!-- Maven Install Plugin -->
      <plugin>
        <artifactId>maven-install-plugin</artifactId>
        <version>2.5.2</version>
      </plugin>

      <!-- Maven Deploy Plugin -->
      <plugin>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>2.8.2</version>
      </plugin>

      <!-- Maven Site Plugin -->
      <plugin>
        <artifactId>maven-site-plugin</artifactId>
        <version>3.9.1</version>
      </plugin>

      <!-- JaCoCo Plugin for Code Coverage -->
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.8.13</version>
        <executions>
          <execution>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>report</id>
            <phase>test</phase>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- Central Publishing Maven Plugin for Maven Central -->
      <plugin>
        <groupId>org.sonatype.central</groupId>
        <artifactId>central-publishing-maven-plugin</artifactId>
        <version>0.10.0</version>
        <extensions>true</extensions>
        <configuration>
          <publishingServerId>central</publishingServerId>
          <autoPublish>true</autoPublish>
          <waitUntil>published</waitUntil>
        </configuration>
      </plugin>

      <!-- Maven GPG Plugin for signing artifacts -->
      <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>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>samples</id>
      <properties>
        <exec.mainClass>examples.Program</exec.mainClass>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <version>3.6.0</version>
            <executions>
              <execution>
                <id>add-samples-source</id>
                <phase>generate-sources</phase>
                <goals>
                  <goal>add-source</goal>
                </goals>
                <configuration>
                  <sources>
                    <source>samples/src/main/java</source>
                  </sources>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>3.0.0</version>
            <configuration>
              <mainClass>${exec.mainClass}</mainClass>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
