<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>org.bsc.async</groupId>
  <artifactId>async-generator</artifactId>
  <version>1.0.0</version>
  <packaging>jar</packaging>
  <description>a Java version of Javascript async generator</description>

  <name>async-generator</name>
  <url>https://github.com/bsorrentino/java-async-generator</url>

  <licenses>
    <license>
      <name>MIT</name>
      <url>https://opensource.org/license/mit</url>
    </license>
  </licenses>
  <developers>
    <developer>
      <id>bsorrentino</id>
      <name>Bartolomeo Sorrentino</name>
      <email>bartolomeo.sorrentino@gmail.com</email>
    </developer>
  </developers>
  <scm>
    <connection>scm:git:https://github.com/bsorrentino/java-async-generator.git</connection>
    <developerConnection>scm:git:https://github.com/bsorrentino/java-async-generator.git</developerConnection>
    <url>https://github.com/bsorrentino/java-async-generator</url>
    <tag>HEAD</tag>
  </scm>
  <issueManagement>
    <system>github</system>
    <url>https://github.com/bsorrentino/java-async-generator/issues</url>
  </issueManagement>

  <distributionManagement>
    <repository>
      <id>${release.repo.id}</id>
      <name>central</name>
      <url>${release.repo.url}</url>
    </repository>
    <snapshotRepository>
      <id>${snapshot.repo.id}</id>
      <name>snapshots</name>
      <url>${snapshot.repo.url}</url>
    </snapshotRepository>
  </distributionManagement>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>

  </properties>

  <dependencyManagement>
    <dependencies>
    <dependency>
      <groupId>org.junit</groupId>
      <artifactId>junit-bom</artifactId>
      <version>5.10.2</version>
      <type>pom</type>
      <scope>import</scope>
    </dependency>
  </dependencies>
  </dependencyManagement>

  <dependencies>

    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <build>
    <pluginManagement>
      <plugins>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>3.6.3</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.3.0</version>
        </plugin>

        <plugin>
          <groupId>se.bjurr.gitchangelog</groupId>
          <artifactId>git-changelog-maven-plugin</artifactId>
          <version>1.89</version>
        </plugin>

      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>3.2.5</version>
        <configuration>
          <systemProperties>
            <property>
              <name>java.util.logging.config.file</name>
              <value>src/test/resources/logging.properties</value>
            </property>
          </systemProperties>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <id>default-package-jdk11</id>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <classifier>jdk11</classifier>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>se.bjurr.gitchangelog</groupId>
        <artifactId>git-changelog-maven-plugin</artifactId>
        <inherited>false</inherited>
        <!-- Minimal config // -->
        <configuration>
          <settingsFile>changelog.json</settingsFile>
          <file>CHANGELOG.md</file>
        </configuration>
      </plugin>

    </plugins>
  </build>


  <profiles>
    <profile>
      <id>release</id>
      <build>

        <plugins>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <executions>
              <execution>
                <id>enforce-no-snapshots</id>
                <goals>
                  <goal>enforce</goal>
                </goals>
                <phase>verify</phase>
                <configuration>
                  <rules>
                    <requireReleaseDeps>
                      <message>No Snapshots Allowed!</message>
                    </requireReleaseDeps>
                  </rules>
                  <fail>true</fail>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <!--
          ====================================================================================
          # https://github.com/keybase/keybase-issues/issues/2798
          export GPG_TTY=$(tty)
          mvn -Prelease source:jar javadoc:jar deploy -Dgpg.passphrase=thephrase
          ====================================================================================
          -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>3.2.4</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <gpgArguments>
                <arg>--pinentry-mode</arg>
                <arg>loopback</arg>
              </gpgArguments>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.7</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>sonatype-server</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
