<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2013 The OSGL Storage Project
  ~
  ~ The Java Tool 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.osgl</groupId>
    <artifactId>osgl-storage</artifactId>
    <packaging>jar</packaging>
    <version>1.4.2</version>

    <name>Java Storage Service</name>
    <description>A simple storage service supports plugin varieties of implementations including Amazon S3</description>
    <url>http://java-storage.osgl.org/</url>
    <inceptionYear>2013</inceptionYear>

    <organization>
        <name>OSGL (Open Source General Library)</name>
        <url>http://osgl.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>
        <scm.url>git@github.com:osglworks/java-storage.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>
        <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-10</osgl-bootstrap.version>
        <osgl-logging.version>1.0.2</osgl-logging.version>
        <osgl-tool.version>1.4.3</osgl-tool.version>
        <osgl-ut.version>1.0.0-BETA-5</osgl-ut.version>

        <spring.version>3.2.6.RELEASE</spring.version>
        <aws-sdk.version>1.11.109</aws-sdk.version>
        <azure-storage.version>5.0.0</azure-storage.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>
                    <source>7</source>
                    <target>7</target>
                </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>1.13</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.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>
        </dependency>

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

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

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

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${spring.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${spring.version}</version>
            <scope>provided</scope>
        </dependency>


        <!-- AWS S3 storage system -->
        <dependency>
            <groupId>com.amazonaws</groupId>
            <artifactId>aws-java-sdk-s3</artifactId>
            <version>${aws-sdk.version}</version>
            <scope>provided</scope>
        </dependency>

        <!-- Azure Blog storage system -->
        <dependency>
            <groupId>com.microsoft.azure</groupId>
            <artifactId>azure-storage</artifactId>
            <version>${azure-storage.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://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>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
