<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>com.netcetera.trema</groupId>
  <artifactId>trema-maven-plugin</artifactId>
  <version>0.4.0</version>
  <packaging>maven-plugin</packaging>
  <name>${project.artifactId}</name>
  <description>Trema - Text resource management</description>
  <url>https://github.com/netceteragroup/trema-maven</url>
  <inceptionYear>2014</inceptionYear>

  <prerequisites>
    <maven>3.0.0</maven>
  </prerequisites>

  <organization>
    <name>Netcetera</name>
    <url>https://www.netcetera.com</url>
  </organization>

  <licenses>
    <license>
      <name>MIT License</name>
      <url>https://opensource.org/licenses/mit-license.php</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>jstadler</id>
      <name>Jacques Stadler</name>
      <email>firstname dot lastname at netcetera.com</email>
    </developer>
    <developer>
      <id>mstoer</id>
      <name>Marcel Stör</name>
      <email>firstname dot lastname at netcetera.com</email>
    </developer>
  </developers>

  <scm>
    <url>${project.url}</url>
    <connection>scm:git:git@github.com:netceteragroup/trema-maven.git</connection>
    <developerConnection>scm:git:git@github.com:netceteragroup/trema-maven.git</developerConnection>
    <tag>trema-maven-plugin-0.4.0</tag>
  </scm>

  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <name>Maven Central Snapshot Repository</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>ossrh</id>
      <name>Maven Central Staging Repository</name>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
    <site>
      <id>gh-pages</id>
      <url>${project.scm.developerConnection}</url>
    </site>
  </distributionManagement>

  <properties>
    <!-- How to detect if you're running the latest version of the configured dependencies:
         mvn -N versions:display-property-updates OR
         mvn -N versions:display-plugin-updates
    -->

    <jdk.version>1.8</jdk.version>
    <maven.version>3.0.5</maven.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

    <!-- Dependencies -->
    <trema-core.version>0.4.0</trema-core.version>
    <hamcrest.version>2.2</hamcrest.version>
    <junit.version>5.8.2</junit.version>
    <mockito.version>4.1.0</mockito.version>
    <maven-plugin-api.version>3.8.4</maven-plugin-api.version>
    <plexus-build-api.version>0.0.7</plexus-build-api.version>

    <!-- Plugins -->
    <coveralls-maven-plugin.version>4.3.0</coveralls-maven-plugin.version>
    <jacoco-maven-plugin.version>0.8.7</jacoco-maven-plugin.version>
    <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
    <maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
    <maven-javadoc-plugin.version>3.3.1</maven-javadoc-plugin.version>
    <maven-plugin-plugin.version>3.6.2</maven-plugin-plugin.version>
    <maven-project-info-reports-plugin.version>3.1.2</maven-project-info-reports-plugin.version>
    <maven-release-plugin.version>2.5.3</maven-release-plugin.version>
    <maven-resources-plugin.version>2.6</maven-resources-plugin.version>
    <maven-scm-publish-plugin.version>3.1.0</maven-scm-publish-plugin.version>
    <maven-site-plugin.version>3.9.1</maven-site-plugin.version>
    <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
    <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>com.netcetera.trema</groupId>
      <artifactId>trema-core</artifactId>
      <version>${trema-core.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>${maven-plugin-api.version}</version>
    </dependency>
    <dependency>
      <groupId>org.sonatype.plexus</groupId>
      <artifactId>plexus-build-api</artifactId>
      <version>${plexus-build-api.version}</version>
    </dependency>

    <!-- Test Dependencies -->
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>${mockito.version}</version>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest</artifactId>
      <version>${hamcrest.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.eluder.coveralls</groupId>
        <artifactId>coveralls-maven-plugin</artifactId>
        <version>${coveralls-maven-plugin.version}</version>
        <!--The Coveralls API token is made available as 'repoToken' env variable by Travis CI (see .travis.yml for secure -->
        <!--env). If it weren't you could define it here and reference some property from your settings.xml. -->
        <!--<configuration> -->
        <!--<repoToken>${coveralls.trema-core.token}</repoToken> -->
        <!--</configuration> -->
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>${jacoco-maven-plugin.version}</version>
        <configuration>
          <!--<excludes /> -->
        </configuration>
        <executions>
          <execution>
            <id>prepare-agent</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

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

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven-surefire-plugin.version}</version>
        <configuration>
          <runOrder>random</runOrder>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>${maven-release-plugin.version}</version>
        <configuration>
          <autoVersionSubmodules>true</autoVersionSubmodules>
          <useReleaseProfile>false</useReleaseProfile>
          <!-- references the profile defined just below -->
          <releaseProfiles>release</releaseProfiles>
          <goals>deploy</goals>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>${maven-site-plugin.version}</version>
        <configuration>
          <!-- We are deploying site using scm-publish, not site-deploy... -->
          <skipDeploy>true</skipDeploy>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
        <version>${maven-plugin-plugin.version}</version>
        <configuration>
          <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
        </configuration>
        <executions>
          <execution>
            <id>mojo-descriptor</id>
            <goals>
              <goal>descriptor</goal>
            </goals>
          </execution>
          <execution>
            <id>generated-helpmojo</id>
            <goals>
              <goal>helpmojo</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-scm-publish-plugin</artifactId>
        <version>${maven-scm-publish-plugin.version}</version>
        <configuration>
          <scmBranch>gh-pages</scmBranch>
          <pubScmUrl>${project.scm.developerConnection}</pubScmUrl>
          <content>${project.reporting.outputDirectory}</content>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>publish-scm</goal>
            </goals>
            <phase>site-deploy</phase>
          </execution>
        </executions>
      </plugin>
    </plugins>

    <pluginManagement>
      <plugins>
        <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
        <plugin>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-plugin-plugin</artifactId>
                    <versionRange>[3.3,)</versionRange>
                    <goals>
                      <goal>descriptor</goal>
                      <goal>helpmojo</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>${maven-project-info-reports-plugin.version}</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
        <reportSets>
          <reportSet>
            <reports>
              <report>report</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
    </plugins>
  </reporting>

  <profiles>
    <!-- all plugins below are usually only required for release builds -->
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>${maven-source-plugin.version}</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>${maven-javadoc-plugin.version}</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}</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>java8</id>
      <activation>
        <jdk>1.8</jdk>
      </activation>
      <properties>
        <!--Turn of the silly Java 8 Javadoc linter because it complains about unknown annotations when it encounters Mojo JavaDoc Tags such as '@phase'.-->
        <additionalparam>-Xdoclint:none</additionalparam>
      </properties>
    </profile>
  </profiles>
</project>
