<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2013 The Ebean Plugin for ACT Framework
  ~
  ~ The ACT framework 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>act-ebean</artifactId>
  <packaging>jar</packaging>
  <version>1.2.3</version>

  <name>ACT Ebean</name>
  <description>Provides SQL database access through Ebean ORM library (java 7+)</description>
  <url>http://actframework.org/plugin/ebean</url>
  <inceptionYear>2015</inceptionYear>

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

  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>7</version>
  </parent>

  <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-ebean.git</scm.url>

    <maven-checkstyle-plugin.version>2.17</maven-checkstyle-plugin.version>
    <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>

    <buildnumber-maven-plugin.version>1.4</buildnumber-maven-plugin.version>
    <checkstyle.version>8.1</checkstyle.version>
    <cobertura-maven-plugin.version>2.7</cobertura-maven-plugin.version>
    <errorpone-core.version>2.1.1</errorpone-core.version>
    <license-maven-plugin.version>1.13</license-maven-plugin.version>
    <markdown-doclet.version>1.4</markdown-doclet.version>
    <plexus-compiler-javac-errorprone.version>2.8.2</plexus-compiler-javac-errorprone.version>

    <osgl-bootstrap.version>1.0.0-BETA-7</osgl-bootstrap.version>
    <osgl-ut.version>1.0.0-BETA-4</osgl-ut.version>

    <ebean.version>8.8.1</ebean.version>
    <ebean-agent.version>8.1.1</ebean-agent.version>
    <ebean-agent-loader.version>2.1.2</ebean-agent-loader.version>

    <act.version>1.4.11</act.version>
    <act-sql-common.version>1.1.2</act-sql-common.version>

  </properties>

  <scm>
    <connection>scm:git:${scm.url}</connection>
    <developerConnection>scm:git:${scm.url}</developerConnection>
    <url>${scm.url}</url>
  </scm>

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

  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${maven-compiler-plugin.version}</version>
        <configuration>
          <compilerId>javac-with-errorprone</compilerId>
          <forceJavacCompilerUse>true</forceJavacCompilerUse>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>org.codehaus.plexus</groupId>
            <artifactId>plexus-compiler-javac-errorprone</artifactId>
            <version>${plexus-compiler-javac-errorprone.version}</version>
          </dependency>
          <!-- override plexus-compiler-javac-errorprone's dependency on
               Error Prone with the latest version -->
          <dependency>
            <groupId>com.google.errorprone</groupId>
            <artifactId>error_prone_core</artifactId>
            <version>${errorpone-core.version}</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
        <version>${cobertura-maven-plugin.version}</version>
        <configuration>
          <formats>
            <format>html</format>
            <format>xml</format>
          </formats>
          <check />
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>${maven-checkstyle-plugin.version}</version>
        <dependencies>
          <dependency>
            <groupId>com.puppycrawl.tools</groupId>
            <artifactId>checkstyle</artifactId>
            <version>${checkstyle.version}</version>
          </dependency>
        </dependencies>
        <configuration>
          <failOnViolation>true</failOnViolation>
          <configLocation>checkstyle.xml</configLocation>
          <encoding>UTF-8</encoding>
          <consoleOutput>true</consoleOutput>
          <failsOnError>true</failsOnError>
        </configuration>
        <executions>
          <execution>
            <id>checkstyle</id>
            <phase>validate</phase>
            <goals>
              <goal>check</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/java</root>
              </roots>
              <excludes>
                <exclude>**/README</exclude>
                <exclude>src/test/resources/**</exclude>
                <exclude>src/main/resources/**</exclude>
              </excludes>
            </configuration>
          </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</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <shortRevisionLength>4</shortRevisionLength>
        </configuration>
      </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>
    </plugins>
  </build>

  <dependencies>

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

    <dependency>
      <groupId>org.avaje.ebean</groupId>
      <artifactId>ebean</artifactId>
      <version>${ebean.version}</version>
    </dependency>

    <dependency>
      <groupId>org.avaje.ebean</groupId>
      <artifactId>ebean-agent</artifactId>
      <version>${ebean-agent.version}</version>
    </dependency>

    <dependency>
      <groupId>org.avaje</groupId>
      <artifactId>avaje-agentloader</artifactId>
      <version>${ebean-agent-loader.version}</version>
    </dependency>

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

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

  </dependencies>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <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://javax-inject.github.io/javax-inject/api/</link>
                <link>https://docs.oracle.com/javaee/7/api/</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>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
