<?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>de.muehlencord.tmc</groupId>
  <artifactId>tm-controller</artifactId>
  <version>1.1.1</version>
  <packaging>pom</packaging>

  <parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>3.5.14</version>
  </parent>

  <modules>
    <module>tmc-spring</module>
  </modules>

  <repositories>
    <repository>
      <id>maven-central</id>
      <name>Maven Central</name>
      <url>https://repo1.maven.org/maven2</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>

    <repository>
      <id>gitea</id>
      <url>https://git.muehlencord.de/api/packages/jomu/maven</url>
    </repository>
  </repositories>

  <scm>
    <connection>scm:git:git@git.muehlencord.de:jomu-private/tm-controller.git</connection>
    <developerConnection>scm:git:git@git.muehlencord.de:jomu-private/tm-controller.git</developerConnection>
    <tag>tm-controller-1.1.1</tag>
    <url>https://git.muehlencord.de/jomu-private/tm-controller</url>
  </scm>

  <inceptionYear>2023</inceptionYear>

  <issueManagement>
    <system>Gitea</system>
    <url>https://git.muehlencord.de/jomu-private/tm-controller/issues</url>
  </issueManagement>

  <distributionManagement>
    <repository>
      <id>jomu-gitea</id>
      <url>https://git.muehlencord.de/api/packages/jomu/maven</url>
    </repository>
    <snapshotRepository>
      <id>jomu-gitea</id>
      <url>https://git.muehlencord.de/api/packages/jomu/maven</url>
    </snapshotRepository>
  </distributionManagement>

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

    <!-- managed dependencies -->
    <spring-boot.version>3.5.14</spring-boot.version>
    <joinfaces.version>5.5.14.1</joinfaces.version>
    <mapstruct.version>1.6.3</mapstruct.version>
    <mapstruct-support.version>1.6.3</mapstruct-support.version>
    <lombok.version>1.18.46</lombok.version>
    <xmlrpc.version>3.1.3</xmlrpc.version>
    <lombok-mapstruct-binding.version>0.2.0</lombok-mapstruct-binding.version>

    <!-- overwrite already managed dependencies -->
    <commons-lang3.version>3.20.0</commons-lang3.version>

    <!-- plugin versions -->
    <cyclonedx-maven-plugin.version>2.9.1</cyclonedx-maven-plugin.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.joinfaces</groupId>
        <artifactId>joinfaces-platform</artifactId>
        <version>${joinfaces.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <dependency>
        <groupId>org.mapstruct</groupId>
        <artifactId>mapstruct</artifactId>
        <version>${mapstruct.version}</version>
      </dependency>
      <dependency>
        <groupId>de.muehlencord.mapstruct</groupId>
        <artifactId>mapstruct-support</artifactId>
        <version>${mapstruct-support.version}</version>
      </dependency>

      <dependency>
        <groupId>org.apache.xmlrpc</groupId>
        <artifactId>xmlrpc-common</artifactId>
        <version>${xmlrpc.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.xmlrpc</groupId>
        <artifactId>xmlrpc-client</artifactId>
        <version>${xmlrpc.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.xmlrpc</groupId>
        <artifactId>xmlrpc-server</artifactId>
        <version>${xmlrpc.version}</version>
        <scope>test</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>
            <showDeprecation>true</showDeprecation>
            <annotationProcessorPaths>
              <path>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>${lombok.version}</version>
              </path>
              <!-- This is needed when using Lombok 1.18.16 and above -->
              <path>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok-mapstruct-binding</artifactId>
                <version>${lombok-mapstruct-binding.version}</version>
              </path>
              <!-- Mapstruct should follow the lombok path(s) -->
              <path>
                <groupId>org.mapstruct</groupId>
                <artifactId>mapstruct-processor</artifactId>
                <version>${mapstruct.version}</version>
              </path>
              <path>
                <groupId>de.muehlencord.mapstruct</groupId>
                <artifactId>mapstruct-support</artifactId>
                <version>${mapstruct-support.version}</version>
              </path>
              <!-- spring boot after lombok -->
              <path>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-configuration-processor</artifactId>
                <version>${spring-boot.version}</version>
              </path>
            </annotationProcessorPaths>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-maven-plugin</artifactId>
          <version>${spring-boot.version}</version>
          <configuration>
            <classifier>starter</classifier>
          </configuration>
        </plugin>

        <plugin>
          <groupId>io.github.git-commit-id</groupId>
          <artifactId>git-commit-id-maven-plugin</artifactId>
          <version>${git-commit-id-maven-plugin.version}</version>
        </plugin>
      </plugins>
    </pluginManagement>


    <plugins>
      <plugin>
        <groupId>org.cyclonedx</groupId>
        <artifactId>cyclonedx-maven-plugin</artifactId>
        <version>${cyclonedx-maven-plugin.version}</version>
        <executions>
          <execution>
            <phase>generate-resources</phase>
            <goals>
              <goal>makeAggregateBom</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <projectType>application</projectType>
          <outputDirectory>${project.build.outputDirectory}/META-INF/sbom</outputDirectory>
          <outputFormat>json</outputFormat>
          <outputName>application.cdx</outputName>
        </configuration>
      </plugin>
    </plugins>


  </build>

</project>
