<?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>org.jxapi</groupId>
  <artifactId>jxapi-maven-plugin</artifactId>
  <version>1.0.0</version>
  <packaging>maven-plugin</packaging>

  <name>jxapi-maven-plugin</name>
  <description>Maven plugin for JXAPI code generation</description>
  <url>https://github.com/scozic/jxapi-maven-plugin</url>

  <!-- Licence Apache 2.0 -->
  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <!-- Auteur -->
  <developers>
    <developer>
      <id>scozic</id>
      <name>Sylvestre Cozic</name>
      <email>scozic.dev@gmail.com</email>
      <url>https://github.com/scozic</url>
    </developer>
  </developers>

  <!-- SCM obligatoire -->
  <scm>
    <url>https://github.com/scozic/jxapi-maven-plugin</url>
    <connection>scm:git:https://github.com/scozic/jxapi-maven-plugin.git</connection>
    <developerConnection>scm:git:git@github.com:scozic/jxapi-maven-plugin.git</developerConnection>
    <tag>HEAD</tag>
  </scm>

  <!-- Dépôts Sonatype -->
  <distributionManagement>
	<repository>
	  <id>central</id>
	  <url>https://central.sonatype.com/api/v1/publisher/upload</url>
	</repository>
	<snapshotRepository>
	  <id>central-snapshots</id>
	  <url>https://central.sonatype.com/api/v1/publisher/upload/snapshots</url>
	</snapshotRepository>
  </distributionManagement> 

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

    <maven.compiler.release>17</maven.compiler.release>

    <maven.plugin.api.version>3.9.9</maven.plugin.api.version>
    <maven.plugin.tools.version>3.15.1</maven.plugin.tools.version>

    <jxapi-core.version>${project.version}</jxapi-core.version>
  </properties>

  <!-- Dépendances -->
  <dependencies>

    <!-- API Maven Plugin -->
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>${maven.plugin.api.version}</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>${maven.plugin.api.version}</version>
      <scope>provided</scope>
    </dependency>

    <!-- Annotations Mojo -->
    <dependency>
      <groupId>org.apache.maven.plugin-tools</groupId>
      <artifactId>maven-plugin-annotations</artifactId>
      <version>${maven.plugin.tools.version}</version>
      <scope>provided</scope>
    </dependency>

    <!-- Dépendance vers ton core -->
    <dependency>
      <groupId>org.jxapi</groupId>
      <artifactId>jxapi-core</artifactId>
      <version>${jxapi-core.version}</version>
    </dependency>

  </dependencies>

  <build>
    <plugins>

      <!-- Compiler -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.11.0</version>
        <configuration>
          <release>${maven.compiler.release}</release>
        </configuration>
      </plugin>

      <!-- Génération du descriptor du plugin -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
        <version>${maven.plugin.tools.version}</version>
        <configuration>
          <goalPrefix>jxapi</goalPrefix>
        </configuration>
        <executions>
          <execution>
            <id>descriptor</id>
            <goals>
              <goal>descriptor</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- sources.jar -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.3.0</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals><goal>jar</goal></goals>
          </execution>
        </executions>
      </plugin>

      <!-- javadoc.jar -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.6.0</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals><goal>jar</goal></goals>
          </execution>
        </executions>
      </plugin>

      <!-- Signature GPG -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
        <version>3.1.0</version>
        <executions>
          <execution>
            <id>sign-artifacts</id>
            <phase>verify</phase>
            <goals><goal>sign</goal></goals>
          </execution>
        </executions>
      </plugin>
	
	  <!-- SonaType Maven Central deployment -->      
      <plugin>
		<groupId>org.sonatype.central</groupId>
		<artifactId>central-publishing-maven-plugin</artifactId>
		<version>0.5.0</version>
		<extensions>true</extensions>
	  </plugin>

    </plugins>
  </build>

</project>
