<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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>io.github.marcoratto</groupId>
  <artifactId>mqttsn12-java-client</artifactId>
  <packaging>jar</packaging>
  <version>1.0.0</version>

  <name>mqttsn12-java-client</name>
  <description>Java Client implementation of the Protocol MQTT-SN 1.2</description>
  <url>https://github.com/marcoratto/mqttsn12-java-client</url>

	<licenses>
		<license>
			<name>MIT License</name>
			<url>https://opensource.org/licenses/MIT</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

    <developers>
        <developer>
            <id>marcoratto</id>
            <name>Marco Ratto</name>
            <email>marcoratto@gmail.com</email>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git://github.com/marcoratto/mqttsn12-java-client.git</connection>
        <developerConnection>scm:git:ssh://github.com/marcoratto/mqttsn12-java-client.git</developerConnection>
        <url>https://github.com/marcoratto/mqttsn12-java-client</url>
    </scm>
                  
  <dependencies>
	  
	<dependency>
		<groupId>junit</groupId>
		<artifactId>junit</artifactId>
		<version>4.13.2</version>
		<scope>test</scope>
	</dependency>

	<dependency>
		<groupId>org.apache.logging.log4j</groupId>
		<artifactId>log4j-core</artifactId>
		<version>2.20.0</version>
	</dependency>
	<dependency>
		<groupId>org.apache.logging.log4j</groupId>
		<artifactId>log4j-api</artifactId>
		<version>2.20.0</version>
	</dependency>
    <!-- SLF4J API -->
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>2.0.9</version>
    </dependency>
    	
    <!-- Eclipse Paho MQTT client (solo test) -->
    <dependency>
        <groupId>org.eclipse.paho</groupId>
        <artifactId>org.eclipse.paho.client.mqttv3</artifactId>
        <version>1.2.5</version>
        <scope>test</scope>
    </dependency>

    <!-- Apache Commons Collections4 (solo test) -->
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-collections4</artifactId>
        <version>4.4</version>
        <scope>test</scope>
    </dependency>	
  </dependencies>

<build>
    <plugins>
      <!-- Compiler -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.11.0</version>
        <configuration>
          <source>17</source>
          <target>17</target>
        </configuration>
      </plugin>

      <!-- Sources JAR -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.3.1</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <phase>verify</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- Javadoc JAR -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.5.0</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <phase>verify</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- JaCoCo coverage -->
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.8.12</version>
        <executions>
          <execution>
            <id>prepare-agent</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>report</id>
            <phase>verify</phase>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      		
        <!-- Surefire Plugin per eseguire i test -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>3.1.2</version>
        </plugin>

        <!-- Surefire Report Plugin per generare report HTML -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-report-plugin</artifactId>
            <version>3.1.2</version>
            <executions>
                <execution>
                    <id>generate-surefire-html-report</id>
                    <phase>verify</phase>
                    <goals>
                        <goal>report-only</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>	
        <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.8.12</version>
            <executions>
                <!-- Attiva JaCoCo durante i test -->
                <execution>
                    <id>prepare-agent</id>
                    <goals>
                        <goal>prepare-agent</goal>
                    </goals>
                </execution>

                <!-- Genera report dopo i test -->
                <execution>
                    <id>report</id>
                    <phase>verify</phase>
                    <goals>
                        <goal>report</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        
		<plugin>
		  <groupId>org.apache.maven.plugins</groupId>
		  <artifactId>maven-gpg-plugin</artifactId>
		  <version>3.2.1</version>
		  <executions>
			<execution>
			  <id>sign-artifacts</id>
			  <phase>verify</phase>
			  <goals>
				<goal>sign</goal>
			  </goals>			  
			</execution>
		  </executions>
      <configuration>
        <keyname>${gpg.keyname}</keyname>   
      </configuration>		  
		</plugin>      
		
        <plugin>
          <groupId>org.sonatype.central</groupId>
          <artifactId>central-publishing-maven-plugin</artifactId>
          <version>0.9.0</version>
          <extensions>true</extensions>
          <configuration>
            <publishingServerId>central</publishingServerId>
          </configuration>
        </plugin>		
          
    </plugins>
</build> 
</project>
