<?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/maven-v4_0_0.xsd">

  <!-- ==================================================================== -->
  <!-- Build requires Java SE 8 or later -->
  <!-- Releases require Java SE 11 or later -->
  <!-- ==================================================================== -->
  <parent>
    <groupId>org.joda</groupId>
    <artifactId>joda-parent</artifactId>
    <version>1.4.0</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>joda-money</artifactId>
  <packaging>jar</packaging>
  <name>Joda-Money</name>
  <version>1.0.2</version>
  <description>Money representation and formatting</description>
  <url>https://www.joda.org/${joda.artifactId}/</url>

  <!-- ==================================================================== -->
  <inceptionYear>2009</inceptionYear>
  <scm>
    <connection>scm:git:https://github.com/JodaOrg/${joda.artifactId}.git</connection>
    <developerConnection>scm:git:https://github.com/JodaOrg/${joda.artifactId}.git</developerConnection>
    <url>https://github.com/JodaOrg/${joda.artifactId}</url>
    <tag>v1.0.2</tag>
  </scm>

  <!-- ==================================================================== -->
  <developers>
    <developer>
      <id>jodastephen</id>
      <name>Stephen Colebourne</name>
      <roles>
        <role>Project Lead</role>
      </roles>
      <timezone>0</timezone>
      <url>https://github.com/jodastephen</url>
    </developer>
  </developers>
  <contributors>
    <contributor>
      <name>Ashish Kumar</name>
      <url>https://github.com/ashish12</url>
    </contributor>
    <contributor>
      <name>Tim Molter</name>
    </contributor>
    <contributor>
      <name>Sarp Güney Başaraner</name>
      <url>https://github.com/sgbasaraner</url>
    </contributor>
    <contributor>
      <name>Gabriel Bauman</name>
      <url>https://github.com/gabrielbauman</url>
    </contributor>
    <contributor>
      <name>Joe Bauser</name>
      <url>https://github.com/coderjoe</url>
    </contributor>
    <contributor>
      <name>Ian Ferguson</name>
      <url>https://github.com/ianferguson</url>
    </contributor>
    <contributor>
      <name>Lukas Vogel</name>
      <url>https://github.com/lukedirtwalker</url>
    </contributor>
    <contributor>
      <name>Michael Weiss</name>
      <url>https://github.com/MiWeiss</url>
    </contributor>
  </contributors>

  <!-- ==================================================================== -->
  <build>
    <pluginManagement>
      <plugins>
        <!-- Setup release -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>${maven-release-plugin.version}</version>
          <configuration>
            <arguments>-Doss.repo</arguments>
            <autoVersionSubmodules>true</autoVersionSubmodules>
            <tagNameFormat>v@{project.version}</tagNameFormat>
            <localCheckout>true</localCheckout>
          </configuration>
          <dependencies>
            <dependency>
              <groupId>org.kohsuke</groupId>
              <artifactId>github-api</artifactId>
              <version>${github-api.version}</version>
            </dependency>
          </dependencies>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <!-- Turn on Checkstyle -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
      </plugin>
      <!-- Turn on JaCoCo -->
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </build>

  <!-- ==================================================================== -->
  <dependencies>
    <dependency>
      <groupId>org.joda</groupId>
      <artifactId>joda-convert</artifactId>
      <version>${joda-convert.version}</version>
      <scope>compile</scope>
      <optional>true</optional><!-- mandatory in Scala -->
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.tngtech.java</groupId>
      <artifactId>junit-dataprovider</artifactId>
      <version>${junit-dataprovider.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <!-- ==================================================================== -->
  <profiles>
    <!-- Main deployment profile, activated by -Doss.repo -->
    <profile>
      <id>release-artifacts</id>
      <activation>
        <property>
          <name>oss.repo</name>
        </property>
      </activation>
      <build>
        <plugins>
          <!-- Create dist files -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-assembly-plugin</artifactId>
            <configuration>
              <attach>false</attach>
              <descriptors>
                <descriptor>src/main/assembly/dist.xml</descriptor>
              </descriptors>
              <tarLongFileMode>gnu</tarLongFileMode>
            </configuration>
            <executions>
              <execution>
                <id>make-assembly</id>
                <phase>install</phase>
                <goals>
                  <goal>single</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <!-- Release dist files to GitHub -->
          <!-- This will create a tag on GitHub on deploy -->
          <!-- The release commit must have been pushed first -->
          <plugin>
            <groupId>de.jutzig</groupId>
            <artifactId>github-release-plugin</artifactId>
            <version>${github-release-plugin.version}</version>
            <configuration>
              <releaseName>Release v${project.version}</releaseName>
              <description>See the [change notes](https://www.joda.org/${joda.artifactId}/changes-report.html#a${project.version}) for more information.</description>
              <tag>v${project.version}</tag>
              <overwriteArtifact>true</overwriteArtifact>
              <fileSets>
                <fileSet>
                  <directory>${project.build.directory}</directory>
                  <includes>
                    <include>${joda.artifactId}*-dist.tar.gz</include>
                    <include>${joda.artifactId}*-dist.zip</include>
                  </includes>
                </fileSet>
              </fileSets>
            </configuration>
            <executions>
              <execution>
                <id>github-releases</id>
                <phase>deploy</phase>
                <goals>
                  <goal>release</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <!-- ==================================================================== -->
  <properties>
    <!-- Dependencies -->
    <junit-dataprovider.version>1.13.1</junit-dataprovider.version>
    <joda-convert.version>2.2.2</joda-convert.version>
    <junit.version>4.13.2</junit.version>
    <!-- Plugins -->
    <github-api.version>1.307</github-api.version>
    <github-release-plugin.version>1.4.0</github-release-plugin.version>
    <!-- Parent pom.xml control -->
    <joda.osgi.packages>org.joda.money.*</joda.osgi.packages>
    <joda.module.name>org.joda.money</joda.module.name>
    <joda.artifactId>joda-money</joda.artifactId>
    <joda.surefire.moduleargs>--add-modules org.joda.convert</joda.surefire.moduleargs>
    <stagingProgressTimeoutMinutes>20</stagingProgressTimeoutMinutes>
    <revapi-maven-plugin.version>0.10.0</revapi-maven-plugin.version>
    <revapi-java.version>0.15.1</revapi-java.version>
  </properties>
</project>
