<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.debugbundle</groupId>
  <artifactId>debugbundle-java-parent</artifactId>
  <version>1.1.0</version>
  <packaging>pom</packaging>

  <name>debugbundle-java-parent</name>
  <description>DebugBundle Java SDK parent</description>
  <url>https://github.com/debugbundle/debugbundle-java</url>

  <licenses>
    <license>
      <name>GNU Affero General Public License v3.0 only</name>
      <url>https://www.gnu.org/licenses/agpl-3.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>debugbundle</id>
      <name>DebugBundle</name>
      <organization>DebugBundle</organization>
      <organizationUrl>https://debugbundle.com</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:https://github.com/debugbundle/debugbundle-java.git</connection>
    <developerConnection>scm:git:git@github.com:debugbundle/debugbundle-java.git</developerConnection>
    <url>https://github.com/debugbundle/debugbundle-java</url>
    <tag>HEAD</tag>
  </scm>

  <modules>
    <module>debugbundle-java-core</module>
    <module>debugbundle-java-web</module>
    <module>debugbundle-java-servlet-jakarta</module>
    <module>debugbundle-java-servlet-javax</module>
    <module>debugbundle-java-jaxrs-jakarta</module>
    <module>debugbundle-java-jaxrs-javax</module>
    <module>debugbundle-java-agent</module>
    <module>debugbundle-spring-boot-starter</module>
  </modules>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.release>17</maven.compiler.release>
    <junit.version>5.12.2</junit.version>
    <assertj.version>3.27.3</assertj.version>
    <jboss.logmanager.version>3.2.2.Final</jboss.logmanager.version>
    <spring.boot.version>3.5.0</spring.boot.version>
    <javax.servlet.version>4.0.1</javax.servlet.version>
    <jakarta.ws.rs.version>3.1.0</jakarta.ws.rs.version>
    <javax.ws.rs.version>2.1.1</javax.ws.rs.version>
    <central.publishing.plugin.version>0.9.0</central.publishing.plugin.version>
    <maven.compiler.plugin.version>3.14.0</maven.compiler.plugin.version>
    <maven.surefire.plugin.version>3.5.3</maven.surefire.plugin.version>
    <maven.source.plugin.version>3.3.1</maven.source.plugin.version>
    <maven.javadoc.plugin.version>3.11.2</maven.javadoc.plugin.version>
    <maven.gpg.plugin.version>3.2.7</maven.gpg.plugin.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.debugbundle</groupId>
        <artifactId>debugbundle-java-core</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>com.debugbundle</groupId>
        <artifactId>debugbundle-java-web</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>com.debugbundle</groupId>
        <artifactId>debugbundle-java-servlet-jakarta</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>com.debugbundle</groupId>
        <artifactId>debugbundle-java-servlet-javax</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>com.debugbundle</groupId>
        <artifactId>debugbundle-java-jaxrs-jakarta</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>com.debugbundle</groupId>
        <artifactId>debugbundle-java-jaxrs-javax</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>com.debugbundle</groupId>
        <artifactId>debugbundle-java-agent</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>com.debugbundle</groupId>
        <artifactId>debugbundle-spring-boot-starter</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>${spring.boot.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.junit</groupId>
        <artifactId>junit-bom</artifactId>
        <version>${junit.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${maven.compiler.plugin.version}</version>
          <configuration>
            <release>${maven.compiler.release}</release>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${maven.surefire.plugin.version}</version>
          <configuration>
            <useModulePath>false</useModulePath>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>${maven.source.plugin.version}</version>
          <executions>
            <execution>
              <id>attach-sources</id>
              <goals>
                <goal>jar-no-fork</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${maven.javadoc.plugin.version}</version>
          <executions>
            <execution>
              <id>attach-javadocs</id>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>${maven.gpg.plugin.version}</version>
            <configuration>
              <gpgArguments>
                <arg>--batch</arg>
                <arg>--yes</arg>
                <arg>--pinentry-mode</arg>
                <arg>loopback</arg>
              </gpgArguments>
            </configuration>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonatype.central</groupId>
            <artifactId>central-publishing-maven-plugin</artifactId>
            <version>${central.publishing.plugin.version}</version>
            <extensions>true</extensions>
            <configuration>
              <publishingServerId>central</publishingServerId>
              <deploymentName>debugbundle-java ${project.version}</deploymentName>
              <autoPublish>true</autoPublish>
              <waitUntil>published</waitUntil>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
