<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>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <!--<netty.version>4.1.12.Final</netty.version>-->
        <source.version>1.8</source.version>
        <target.version>1.8</target.version>
        <junit.version>5.9.3</junit.version>
        <slf4j.version>2.0.7</slf4j.version>

        <maven-gpg-plugin>1.6</maven-gpg-plugin>
        <maven-javadoc-plugin>3.2.0</maven-javadoc-plugin>
        <maven-nexus-staging-plugin>1.6.8</maven-nexus-staging-plugin>
        <maven-source-plugin>3.2.1</maven-source-plugin>
    </properties>

    <groupId>de.fraunhofer.iosb.io.moquette</groupId>
    <artifactId>moquette-parent</artifactId>

    <packaging>pom</packaging>
    <version>0.15.2</version>
    <name>Moquette MQTT + patches</name>
    <description>Moquette lightweight MQTT Broker, with added patches.</description>
    <inceptionYear>2011</inceptionYear>
    <url>http://moquette.io</url>

    <licenses>
        <license>
            <name>The Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
        <license>
            <name>Eclipse Public License - Version 1.0</name>
            <url>http://www.eclipse.org/org/documents/epl-v10.php</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>andsel</id>
            <name>Andrea Selva</name>
            <roles>
                <role>architect</role>
                <role>developer</role>
                <role>founder</role>
            </roles>
            <timezone>+1</timezone>
        </developer>
        <developer>
            <id>scf</id>
            <name>Hylke van der Schaaf</name>
            <roles>
                <role>developer</role>
            </roles>
            <timezone>+1</timezone>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git@github.com:FraunhoferIOSB/moquette.git</connection>
        <developerConnection>scm:git:git@github.com:FraunhoferIOSB/moquette.git</developerConnection>
        <url>git@github.com:FraunhoferIOSB/moquette.git</url>
        <tag>v0.15.2</tag>
  </scm>

    <modules>
        <module>broker</module>
        <!-- module>distribution</module -->
        <!-- module>embedding_moquette</module -->
    </modules>

    <dependencies>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-params</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-reload4j</artifactId>
            <version>${slf4j.version}</version>
            <scope>test</scope>
        </dependency>

        <!-- needs extra dependencies: objenesis & hamcrest -->
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>4.10.0</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>3.24.2</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.awaitility</groupId>
            <artifactId>awaitility</artifactId>
            <version>4.2.0</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <version>2.6</version>
            </plugin>
        </plugins>
    </reporting>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.22.1</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <source>${source.version}</source>
                        <target>${target.version}</target>
                    </configuration>
                </plugin>

                <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-checkstyle-plugin</artifactId>
                  <version>3.2.2</version>
                  <configuration>
                      <configLocation>checkstyle.xml</configLocation>
                      <!--<suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>-->
                      <!--
                         <configLocation>/google_checks.xml</configLocation>
                       -->
                      <failOnViolation>true</failOnViolation>
                      <consoleOutput>true</consoleOutput>
                  </configuration>
                  <executions>
                    <execution>
                      <phase>validate</phase>
                      <goals>
                        <goal>check</goal>
                      </goals>
                    </execution>
                  </executions>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>release-sign-artifacts</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${maven-source-plugin}</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

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

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven-gpg-plugin}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <!-- Avoid GPG to enter passphrase-->
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>${maven-nexus-staging-plugin}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>false</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <repositories>
        <repository>
            <id>Maven repo</id>
            <url>https://repo1.maven.org/maven2/</url>
        </repository>

        <repository>
            <id>Paho Releases</id>
            <url>https://repo.eclipse.org/content/repositories/paho-releases/</url>
        </repository>

        <repository>
            <id>sonatype-snapshots</id>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </repository>
    </repositories>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

</project>
