<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>org.nerd4j</groupId>
  <artifactId>nerd4j-base</artifactId>
  <version>2.0.0</version>

  <packaging>pom</packaging>

  <name>Nerd4j Project</name>
  <description>Base super-pom for all Nerd4J projects</description>

  <url>http://www.nerd4j.org</url>

  <inceptionYear>2011</inceptionYear>

  <licenses>
    <license>
      <name>GNU Lesser General Public License, version 3.0</name>
      <url>https://opensource.org/licenses/LGPL-3.0</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <organization>
    <name>Nerd4j</name>
    <url>http://nerd4j.org</url>
  </organization>

  <developers>

    <developer>
      <id>massimo.coluzzi</id>
      <name>Massimo Coluzzi</name>
      <email>massimo.coluzzi@gmail.com</email>
      <url>https://www.linkedin.com/in/massimo-coluzzi/</url>
    </developer>

  </developers>

  <scm>
    <url>https://git-codecommit.us-east-1.amazonaws.com/v1/repos/nerd4j-base</url>
    <connection>scm:git:ssh://git-codecommit.us-east-1.amazonaws.com/v1/repos/nerd4j-base</connection>
    <developerConnection>scm:git:ssh://git-codecommit.us-east-1.amazonaws.com/v1/repos/nerd4j-base</developerConnection>
    <tag>nerd4j-base-2.0.0</tag>
  </scm>

  <properties>
    <maven.test.skip>true</maven.test.skip>
    <project.scm.id>codecommit</project.scm.id>
    <project.java.version>1.8</project.java.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>  
  </properties>

  <build>

    <pluginManagement>

      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>3.0.0-M3</version>
          <executions>
            <execution>
              <id>enforce</id>
              <goals>
                <goal>enforce</goal>
              </goals>
              <configuration>
                <rules>
                  <requireNoRepositories>
                    <message>Best Practice is to never define repositories in pom.xml (use a repository manager instead)</message>
                  </requireNoRepositories>
                  <requireMavenVersion>
                    <version>3.3.9</version>
                  </requireMavenVersion>
                  <requireJavaVersion>
                    <version>${project.java.version}</version>
                  </requireJavaVersion>
                </rules>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.1.0</version>
          <configuration>
            <encoding>${project.build.sourceEncoding}</encoding>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.8.1</version>
          <configuration>
            <source>${project.java.version}</source>
            <target>${project.java.version}</target>
            <encoding>${project.build.sourceEncoding}</encoding>
            <optimize>true</optimize>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.2.0</version>
          <configuration>
            <archive>
              <!-- Entry to write into MANIFEST.MF-->
              <manifestEntries>
                <Built-By>nerd4j.org</Built-By>
                <Bundle-Description>${project.description}</Bundle-Description>
                <Implementation-Version>${project.version}</Implementation-Version>
              </manifestEntries>
            </archive>
          </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>
              <phase>verify</phase>
              <goals>
                <goal>jar-no-fork</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <!-- License and header file handler -->
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>1.20</version>
          <configuration>
            <verbose>false</verbose>
            <licenseName>lgpl_v3</licenseName>
          </configuration>

          <executions>

            <execution>
              <id>license-file-header</id>
              <goals>
                <goal>update-file-header</goal>
              </goals>
              <phase>process-sources</phase>
              <configuration>
                <addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
              </configuration>
            </execution>

            <execution>
              <id>license-project</id>
              <goals>
                <goal>update-project-license</goal>
              </goals>
              <phase>process-resources</phase>
              <configuration>
                <generateBundle>true</generateBundle>
              </configuration>
            </execution>

          </executions>

        </plugin>


        <!-- PLUGIN TO PERFORM TESTS WITH JUNIT5 -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>3.0.0-M4</version>
        </plugin>


        <!-- PLUG-IN TO BE USED TO GENERATE DOCUMENTATION SITE -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-site-plugin</artifactId>
          <version>3.8.2</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-project-info-reports-plugin</artifactId>
          <version>2.7</version>
        </plugin>


        <!-- PLUG-IN USED TO MAKE CODE RELEASES -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>3.0.0-M1</version>
        </plugin>


        <!-- PLUG-IN FOR GPG SIGNATURE INTO JAR -->
        <!-- See: https://docs.sonatype.org/display/Repository/How+To+Generate+PGP+Signatures+With+Maven -->
        <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>

        <!-- SONATYPE RELEASE PLUGIN -->
        <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>
            <!--
            No autorelease, will require
              mvn -Pdeploy clean deploy
              mvn -Pdeploy nexus-staging:release
            See: http://central.sonatype.org/pages/apache-maven.html#nexus-staging-maven-plugin-for-deployment-and-release
            -->
            <autoReleaseAfterClose>false</autoReleaseAfterClose>
          </configuration>

        </plugin>

      </plugins>

    </pluginManagement>


    <plugins>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
      </plugin>

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

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
      </plugin>

      <!-- License and header file handler -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>license-maven-plugin</artifactId>
      </plugin>

      <!-- PLUG-IN USED TO MAKE CODE RELEASES -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
      </plugin>

    </plugins>


  </build>


  <profiles>

    <!-- PROFILE TO BE USED DURING SONATYPE RELEASES -->
    <profile>

      <id>deploy</id>

      <build>

        <plugins>

          <!-- PLUG-IN TO ENSURE JAVADOC IS AVAILABLE IN RELEASE -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <phase>verify</phase>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <!-- PLUG-IN FOR GPG SIGNATURE INTO JAR -->
          <!-- See: https://docs.sonatype.org/display/Repository/How+To+Generate+PGP+Signatures+With+Maven -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
          </plugin>

          <!-- SONATYPE RELEASE PLUGINS -->
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
          </plugin>

        </plugins>

      </build>

    </profile>

  </profiles>


  <reporting>

    <plugins>

      <!-- PLUG-IN TO BE USED TO GENERATE DOCUMENTATION SITE -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <reportSets>
          <reportSet>
            <reports>
              <report>index</report>
              <report>summary</report>
              <report>license</report>
              <report>dependency-info</report>
              <report>dependency-convergence</report>
              <report>project-team</report>
              <report>dependencies</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>


      <!-- PLUG-IN FOR ADDING JAVADOC INTO MAVEN SITE -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.1.1</version>
        <configuration>
          <show>public</show>
        </configuration>
        <reportSets>
          <reportSet>
            <reports>
              <report>javadoc</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>

    </plugins>
  </reporting>


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