<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>

  <!-- required to stage artifacts to Sonatype OSS -->
  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>7</version>
  </parent>

  <groupId>org.jcommons</groupId>
  <artifactId>jcommons-lang</artifactId>
  <version>1.0.0</version>
  <packaging>jar</packaging>

  <name>jcommons.lang</name>
  <description>Java Common Libraries Extensions / Language Utilities</description>
  <url>http://www.jcommons.org</url>
  <scm>
    <url>https://github.com/goeckeler/jcommons.lang</url>
    <connection>scm:git:git@github.com:goeckeler/jcommons.lang.git</connection>
    <developerConnection>scm:git:git@github.com:goeckeler/jcommons.lang.git</developerConnection>
  </scm>

  <!-- Global settings -->
  <properties>
    <!-- default JDK version to be used -->
    <jdk.version>1.7</jdk.version>

    <!-- compiler setup -->
    <source.jdk.version>${jdk.version}</source.jdk.version>
    <target.jdk.version>${jdk.version}</target.jdk.version>
    <!-- source file encoding for all files -->
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    <!-- ************************************************************************ -->
    <!-- VERSIONS, SORTED ALPHABETICALLY -->
    <!-- ************************************************************************ -->

    <commons.lang.version>3.1</commons.lang.version>
    <joda.version>2.3</joda.version>
    <junit.version>4.11</junit.version>
    <junit.hamcrest.version>1.3</junit.hamcrest.version>
  </properties>

  <build>
    <!-- most common used command to run maven, so you can just hit "mvn" instead of "mvn clean install" -->
    <defaultGoal>clean install</defaultGoal>

    <plugins>
      <!-- compiler setup -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>${source.jdk.version}</source>
          <target>${target.jdk.version}</target>
        </configuration>
      </plugin>

      <!-- support release builds -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <configuration>
          <mavenExecutorId>forked-path</mavenExecutorId>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-library</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
    </dependency>

    <dependency>
      <groupId>joda-time</groupId>
      <artifactId>joda-time</artifactId>
    </dependency>
  </dependencies>

  <dependencyManagement>
    <dependencies>
      <!-- Apache Commons -->
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>${commons.lang.version}</version>
      </dependency>

      <!-- Date and Time API -->
      <dependency>
        <groupId>joda-time</groupId>
        <artifactId>joda-time</artifactId>
        <version>${joda.version}</version>
      </dependency>

      <!-- Testing -->
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-core</artifactId>
        <version>${junit.hamcrest.version}</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-library</artifactId>
        <version>${junit.hamcrest.version}</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>goeckeler</id>
      <name>Thorsten Göckeler</name>
      <email>webmaster@jcommons.org</email>
    </developer>
  </developers>

  <profiles>
    <!-- mvn release:perform -->
    <profile>
      <id>jcommons-release</id>
      <activation>
        <property>
          <!-- automatically set on mvn release -->
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>

      <!-- automatically sign artifacts on release -->
      <build>
        <plugins>
          <!-- also create *-sources.jar -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>2.2.1</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <phase>verify</phase>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <!-- also create *.javadoc.jar -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.9.1</version>
            <configuration>
              <encoding>${project.build.sourceEncoding}</encoding>
            </configuration>
            <executions>
              <execution>
                <id>attach-docs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          
          <!-- sign the artifacts -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.4</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
