<?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>eu.verdelhan</groupId>
    <artifactId>topaz512-driver</artifactId>
    <version>1.0.0</version>
    <packaging>jar</packaging>

    <name>topaz512-driver</name>
    <description>Driver for Innovision/Broadcom Topaz512 NFC tags</description>
    <url>http://github.com/mdeverdelhan/Topaz512-driver</url>
    <inceptionYear>2020</inceptionYear>
    <developers>
        <developer>
            <name>Marc de Verdelhan</name>
        </developer>
    </developers>
    <licenses>
        <license>
            <name>MIT License</name>
            <comments>All source code is under the MIT license.</comments>
        </license>
    </licenses>
    <issueManagement>
        <system>GitHub</system>
        <url>http://github.com/mdeverdelhan/Topaz512-driver/issues</url>
    </issueManagement>
    <ciManagement>
        <url>http://github.com/mdeverdelhan/Topaz512-driver/actions</url>
    </ciManagement>

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

    <dependencies>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>5.5.2</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <scm>
        <connection>scm:git:https://github.com/mdeverdelhan/Topaz512-driver.git</connection>
        <developerConnection>scm:git:https://github.com/mdeverdelhan/Topaz512-driver.git</developerConnection>
        <url>http://github.com/mdeverdelhan/Topaz512-driver</url>
      <tag>v1.0.0</tag>
  </scm>

<!--    <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>-->

    <profiles>

        <!-- Only when performing a release (i.e. not for snapshots) -->
        <profile>
            <id>releases</id>
            <build>
                <plugins>

                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.8</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>

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

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

                    <!-- Artifact signing -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                </plugins>
            </build>
        </profile>

    </profiles>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
            <!-- Update Surefire version to execute Junit5 tests with old Maven release -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.0</version>
            </plugin>
            <!-- Releases -->
            <!--
            Publish a release on GH packages:
                mvn -Dresume=false -DdryRun=true release:prepare
                mvn -Dresume=false release:prepare release:perform
            -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>3.0.0-M1</version>
                <configuration>
                    <tagNameFormat>v@{project.version}</tagNameFormat>
                    <releaseProfiles>releases</releaseProfiles>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>
