<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.kleegroup.accelerator</groupId>
  <artifactId>accelerator-publish-editix</artifactId>
  <version>1.0.7</version>

  <name>Accelerator Publish-Editix</name>
  <description>Module pour Klee Editix - solution d'edition de documents en ligne basée sur OnlyOffice</description>
  <url>https://www.kleegroup.com</url>

  <licenses>
    <license>
      <name>The Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>Klee Group Accelerator</name>
      <email>accelerator@kleegroup.com</email>
      <organization>Klee Group</organization>
      <organizationUrl>https://www.kleegroup.com</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:https://git.kleegroup.com/bu_m/accelerator/publish/accelerator-publish-editix.git</connection>
    <developerConnection>scm:git:https://git.kleegroup.com/bu_m/accelerator/publish/accelerator-publish-editix.git</developerConnection>
    <url>https://git.kleegroup.com/bu_m/accelerator/publish/accelerator-publish-editix</url>
  </scm>

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

    <!-- Java version -->
    <java.version>17</java.version>

    <!-- Configuration MAVEN -->
    <maven.compiler.source>${java.version}</maven.compiler.source>
    <maven.compiler.target>${java.version}</maven.compiler.target>

    <!-- Versions -->
    <spring.boot.version>3.5.3</spring.boot.version>
    <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version>
    <maven-source-plugin.version>3.3.1</maven-source-plugin.version>
    <build-helper-maven-plugin.version>3.2.0</build-helper-maven-plugin.version>
    <maven-surefire-plugin.version>3.1.2</maven-surefire-plugin.version>
    <sonar-maven-plugin.version>3.9.1.2184</sonar-maven-plugin.version>
    <jacoco-maven-plugin.version>0.8.10</jacoco-maven-plugin.version>
    <maven-javadoc-plugin.version>3.11.2</maven-javadoc-plugin.version>
    <maven-gpg-plugin.version>3.2.8</maven-gpg-plugin.version>
    <license-maven-plugin.version>5.0.0</license-maven-plugin.version>

    <!-- Sonar -->
    <sonar.projectVersion>${project.version}</sonar.projectVersion>
    <sonar.host.url>https://sonar-interne.dev.klee.lan.net</sonar.host.url>
    <sonar.qualitygate.wait>true</sonar.qualitygate.wait>
    <sonar.language>java</sonar.language>
    <sonar.java.source>${java.version}</sonar.java.source>
    <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
    <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
    <sonar.sources>src/main/java</sonar.sources>
    <sonar.coverage.exclusions>
      **/dto/**/*
    </sonar.coverage.exclusions>
    <sonar.exclusions>
      src/test/**,
      **/dto/**/*
    </sonar.exclusions>

    <!-- Signature PGP -->
    <gpg.skip>true</gpg.skip>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>${spring.boot.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <!-- Spring -->
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <!-- Test -->
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-test</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.codehaus.sonar-plugins.java</groupId>
      <artifactId>sonar-jacoco-listeners</artifactId>
      <version>${sonar-jacoco-listeners.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
      <resource>
        <directory>${basedir}</directory>
        <includes>
          <include>LICENSE</include>
          <include>NOTICE</include>
        </includes>
        <targetPath>META-INF</targetPath>
        <filtering>false</filtering>
      </resource>
    </resources>
    <plugins>
      <!-- Add source code JAR -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>${maven-source-plugin.version}</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <phase>verify</phase>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <!-- Add javadoc JAR -->
      <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>
      <!-- Sign artifacts -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
        <version>${maven-gpg-plugin.version}</version>
        <executions>
          <execution>
            <id>sign-artifacts</id>
            <phase>verify</phase>
            <goals>
              <goal>sign</goal>
            </goals>
            <configuration>
              <skip>${gpg.skip}</skip>
              <gpgArguments>
                <arg>--pinentry-mode</arg>
                <arg>loopback</arg>
              </gpgArguments>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <!-- Unit tests -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven-surefire-plugin.version}</version>
      </plugin>
      <!-- Sonarqube analysis -->
      <plugin>
        <groupId>org.sonarsource.scanner.maven</groupId>
        <artifactId>sonar-maven-plugin</artifactId>
        <version>${sonar-maven-plugin.version}</version>
      </plugin>
      <!-- Jacoco report -->
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>${jacoco-maven-plugin.version}</version>
        <executions>
          <execution>
            <id>jacoco-initialize</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>jacoco-report</id>
            <phase>test</phase>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <!-- Set licence header in sources -->
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>${license-maven-plugin.version}</version>
        <configuration>
          <properties>
            <owner>Klee Group</owner>
            <year>2025</year>
          </properties>
          <licenseSets>
            <licenseSet>
              <header>com/mycila/maven/plugin/license/templates/APACHE-2-noemail.txt</header>
              <includes>
                <include>src/main/java/**</include>
                <include>src/test/java/**</include>
                <include>src/test/resources/test/*</include>
              </includes>
            </licenseSet>
          </licenseSets>
        </configuration>
        <executions>
          <execution>
            <id>add-license</id>
            <phase>process-sources</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <!-- Build fat JAR -->
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <version>${spring.boot.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>repackage</goal>
            </goals>
            <configuration>
              <classifier>fat</classifier>
            </configuration>
          </execution>
        </executions>
      </plugin>

    </plugins>
  </build>

  <distributionManagement>
    <repository>
      <id>nexus-klee-public</id>
      <name>Nexus Klee</name>
      <url>https://nexus.kleegroup.com/repository/ACCELERATOR/</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
    <snapshotRepository>
      <id>nexus-klee-public-snapshots</id>
      <name>Nexus Klee</name>
      <url>https://nexus.kleegroup.com/repository/ACCELERATOR-SNAPSHOTS/</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </snapshotRepository>
  </distributionManagement>

</project>
