<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2013 The ActFramework maven parent Project
  ~
  ~ The ActFramework maven parent Project licenses this file to you under the Apache License,
  ~ version 2.0 (the "License"); you may not use this file except in compliance
  ~ with the License. You may obtain a copy of the License at:
  ~
  ~   http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  ~ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  ~ License for the specific language governing permissions and limitations
  ~ under the License.  
  -->
<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.actframework</groupId>
  <artifactId>parent</artifactId>
  <packaging>pom</packaging>
  <version>1.8.8-RC10</version>

  <name>parent</name>
  <description>Parent POM.xml with commonly used pre-configured features for ActFramework projects</description>
  <url>http://maven-parent.actframework.org/</url>
  <inceptionYear>2017</inceptionYear>

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

  <organization>
    <name>ActFramework</name>
    <url>http://actframework.org</url>
  </organization>

  <developers>
    <developer>
      <id>1</id>
      <name>Gelin Luo</name>
      <email>greenlaw110@gmail.com</email>
      <organization>actframework.org</organization>
      <organizationUrl>http://www.actframework.org</organizationUrl>
      <roles>
        <role>Architect</role>
        <role>Developer</role>
      </roles>
      <timezone>+10</timezone>
    </developer>
  </developers>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <maven.compiler.source>1.7</maven.compiler.source>
    <maven.compiler.target>1.7</maven.compiler.target>
    <scm.url>git@github.com:actframework/act-maven-parent.git</scm.url>

    <maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
    <maven-javadoc-plugin.version>3.0.0-M1</maven-javadoc-plugin.version>
    <maven-source-plugin.version>3.0.1</maven-source-plugin.version>
    <nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>

    <buildnumber-maven-plugin.version>1.4</buildnumber-maven-plugin.version>
    <jacoco-maven-plugin.version>0.7.9</jacoco-maven-plugin.version>
    <license-maven-plugin.version>1.13</license-maven-plugin.version>
    <markdown-doclet.version>1.4</markdown-doclet.version>

    <junit.version>4.12</junit.version>
    <mockito.version>2.9.0</mockito.version>
    <slf4j-api.version>1.7.25</slf4j-api.version>

    <osgl-version.version>2.0.0-BETA-1</osgl-version.version>
    <osgl-ut.version>2.0.0-BETA-1</osgl-ut.version>
    <act.version>1.8.8-RC10</act.version>

    <osgl-javadoc.css.url>https://github.com/osglworks/java-version/blob/master/src/etc/javadoc.css</osgl-javadoc.css.url>
    <sonatypeOssDistMgmtSnapshotsUrl>https://oss.sonatype.org/content/repositories/snapshots/</sonatypeOssDistMgmtSnapshotsUrl>
  </properties>

  <issueManagement>
    <system>github</system>
    <url>https://github.com/actframework/act-maven-parent/issues</url>
  </issueManagement>

  <scm>
    <connection>scm:git:${scm.url}</connection>
    <developerConnection>scm:git:${scm.url}</developerConnection>
    <url>https://github.com/osglworks/maven-parent</url>
    <tag>HEAD</tag>
  </scm>

  <distributionManagement>
    <downloadUrl>https://oss.sonatype.org/content/groups/public</downloadUrl>
    <snapshotRepository>
      <id>sonatype-nexus-snapshots</id>
      <name>Sonatype Nexus Snapshots</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
    </snapshotRepository>
    <repository>
      <id>sonatype-nexus-staging</id>
      <name>Nexus Release Repository</name>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <repositories>
    <repository>
      <id>sonatype-nexus-snapshots</id>
      <name>Sonatype Nexus Snapshots</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>

  <build>
    <finalName>${project.artifactId}-${project.version}-b${buildNumber}</finalName>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>

    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
        <filtering>true</filtering>
      </testResource>
    </testResources>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>1.0</version>
        <executions>
          <execution>
            <id>enforce-maven</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>(,2.1.0),(2.1.0,2.2.0),(2.2.0,)</version>
                  <message>Maven 2.1.0 and 2.2.0 produce incorrect GPG signatures and checksums respectively.</message>
                </requireMavenVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${maven-compiler-plugin.version}</version>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>${jacoco-maven-plugin.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>report</id>
            <phase>test</phase>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>${license-maven-plugin.version}</version>
        <configuration>
          <licenseName>apache_v2</licenseName>
          <verbose>false</verbose>
        </configuration>
        <executions>
          <execution>
            <id>first</id>
            <goals>
              <goal>update-file-header</goal>
            </goals>
            <phase>process-sources</phase>
            <configuration>
              <roots>
                <root>src/main/java</root>
                <root>src/test</root>
              </roots>
              <excludes>
                <exclude>**/README</exclude>
                <exclude>src/test/resources/**</exclude>
                <exclude>src/main/resources/**</exclude>
              </excludes>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <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.codehaus.mojo</groupId>
        <artifactId>buildnumber-maven-plugin</artifactId>
        <version>${buildnumber-maven-plugin.version}</version>
        <executions>
          <execution>
            <phase>validate</phase>
            <goals>
              <goal>create-timestamp</goal>
              <goal>create</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <timestampFormat>yyMMdd_HHmm</timestampFormat>
          <shortRevisionLength>4</shortRevisionLength>
          <revisionOnScmFailure>${timestamp}</revisionOnScmFailure>
        </configuration>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>2.1</version>
          <configuration>
            <mavenExecutorId>forked-path</mavenExecutorId>
            <useReleaseProfile>false</useReleaseProfile>
            <arguments>-Prelease</arguments>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <dependencies>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
    </dependency>

    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>${mockito.version}</version>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>${slf4j-api.version}</version>
    </dependency>

    <dependency>
      <groupId>org.osgl</groupId>
      <artifactId>osgl-version</artifactId>
      <version>${osgl-version.version}</version>
    </dependency>

    <dependency>
      <groupId>org.osgl</groupId>
      <artifactId>osgl-ut</artifactId>
      <version>${osgl-ut.version}</version>
    </dependency>

    <dependency>
      <groupId>org.actframework</groupId>
      <artifactId>act</artifactId>
      <version>${act.version}</version>
    </dependency>

  </dependencies>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <artifactId>maven-deploy-plugin</artifactId>
              <configuration>
                <skip>true</skip>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${maven-javadoc-plugin.version}</version>
            <configuration>
              <stylesheetfile>src/etc/javadoc.css</stylesheetfile>
              <doclet>ch.raffael.mddoclet.MarkdownDoclet</doclet>
              <docletArtifact>
                <groupId>ch.raffael.markdown-doclet</groupId>
                <artifactId>markdown-doclet</artifactId>
                <version>${markdown-doclet.version}</version>
              </docletArtifact>
              <useStandardDocletOptions>true</useStandardDocletOptions>
              <links>
                <link>http://junit.org/junit4/javadoc/latest/</link>
              </links>
            </configuration>
            <executions>
              <execution>
                <id>gen-javadoc</id>
                <phase>prepare-package</phase>
                <goals>
                  <goal>javadoc</goal>
                </goals>
              </execution>
              <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>1.1</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <!-- @see http://www.sonatype.com/books/nexus-book/reference/staging-sect-deployment.html -->
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>${nexus-staging-maven-plugin.version}</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>sonatype-nexus-staging</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
            </configuration>
            <executions>
              <execution>
                <id>deploy-to-sonatype</id>
                <phase>deploy</phase>
                <goals>
                  <goal>deploy</goal>
                  <goal>release</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
