<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright 2015 52°North Initiative for Geospatial Open Source
    Software GmbH

    Licensed 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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.n52</groupId>
    <artifactId>parent</artifactId>
    <version>2</version>

    <packaging>pom</packaging>

    <name>52°North Maven Parent Project</name>
    <description>52°North Maven Parent Project</description>
    <url>https://github.com/52North/maven-parents</url>

    <inceptionYear>2015</inceptionYear>

    <organization>
        <name>52°North Initiative for Geospatial Open Source Software GmbH</name>
        <url>http://52north.org</url>
    </organization>

    <developers>
        <developer>
            <id>autermann</id>
            <name>Christian Autermann</name>
            <email>c.autermann@52north.org</email>
            <organization>${project.organization.name}</organization>
            <organizationUrl>${project.organization.url}</organizationUrl>
            <timezone>GMT+1</timezone>
        </developer>
    </developers>

    <scm>
        <url>https://github.com/52North/maven-parents</url>
        <connection>scm:git:https://github.com/52North/maven-parents.git</connection>
        <developerConnection>scm:git:https://github.com/52North/maven-parents.git</developerConnection>
        <tag>v2</tag>
  </scm>

    <issueManagement>
        <system>GitHub issues</system>
        <url>https://github.com/52North/maven-parents/issues?state=open</url>
    </issueManagement>

    <ciManagement>
        <system>Travis CI</system>
        <url>https://travis-ci.org/52North/maven-parents</url>
    </ciManagement>

    <distributionManagement>
        <repository>
            <id>sonatype-nexus-releases</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
        <snapshotRepository>
            <id>sonatype-nexus-snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>
    
    <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>
            <comments>A business-friendly OSS license</comments>
        </license>
    </licenses>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    </properties>

    <build>
        <defaultGoal>install</defaultGoal>

        <plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <inherited>false</inherited>
                <executions>
                    <execution>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>format</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>pl.project13.maven</groupId>
                <artifactId>git-commit-id-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>revision</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>analyze-dependencies</id>
                        <goals>
                            <goal>analyze-only</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>verify</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            
            <plugin>
                <groupId>com.github.dantwining.whitespace-maven-plugin</groupId>
                <artifactId>whitespace-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>process-sources</phase>
                        <goals>
                            <goal>trim</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            
        </plugins>
        
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>1.6</version>
                    <configuration>
                        <useAgent>true</useAgent>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5.2</version>
                    <configuration>
                        <tagNameFormat>v@{project.version}</tagNameFormat>
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>2.4</version>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.groovy.maven</groupId>
                    <artifactId>gmaven-plugin</artifactId>
                    <version>1.0</version>
                </plugin>

                <plugin>
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>2.11</version>
                    <configuration>
                        <aggregate>true</aggregate>
                        <includes>
                            <include>**/*.java</include>
                            <include>**/*.xml</include>
                        </includes>
                        <strictCheck>true</strictCheck>
                        <mapping>
                            <java>SLASHSTAR_STYLE</java>
                        </mapping>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>pl.project13.maven</groupId>
                    <artifactId>git-commit-id-plugin</artifactId>
                    <version>2.2.0</version>
                    <configuration>
                        <dateFormat>yyyy-MM-dd HH:mm:ssZ</dateFormat>
                        <gitDescribe>
                            <skip>true</skip>
                        </gitDescribe>
                        <timestampFormat>{0,date,yyyy-MM-dd HH:mm:ss}</timestampFormat>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.jasig.maven</groupId>
                    <artifactId>maven-notice-plugin</artifactId>
                    <version>1.0.6.1</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.3</version>
                    <configuration>
                        <compilerArgument>-Xlint:all</compilerArgument>
                        <showWarnings>true</showWarnings>
                        <showDeprecation>true</showDeprecation>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>2.10</version>
                    <configuration>
                        <ignoreNonCompile>true</ignoreNonCompile>
                        <failOnWarning>true</failOnWarning>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>1.4.1</version>
                    <configuration>
                        <rules>
                            <dependencyConvergence />
                            <reactorModuleConvergence />
                            <requireNoRepositories>
                                <banRepositories>true</banRepositories>
                                <banPluginRepositories>false</banPluginRepositories>
                                <allowSnapshotRepositories>false</allowSnapshotRepositories>
                                <allowSnapshotPluginRepositories>false</allowSnapshotPluginRepositories>
                                <allowedRepositories>
                                    <id>sonatype-nexus-snapshots</id>
                                </allowedRepositories>
                                <allowedPluginRepositories />
                            </requireNoRepositories>
                            <requireJavaVersion>
                                <version>[1.7,)</version>
                            </requireJavaVersion>
                            <requirePluginVersions>
                                <banLatest>true</banLatest>
                                <banRelease>true</banRelease>
                                <banSnapshots>true</banSnapshots>
                                <phases>clean,deploy</phases>
                            </requirePluginVersions>
                        </rules>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>cobertura-maven-plugin</artifactId>
                    <version>2.7</version>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>findbugs-maven-plugin</artifactId>
                    <version>3.0.2</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>2.10.3</version>
                    <configuration>
                        <show>package</show>
                        <author>false</author>
                        <quiet>true</quiet>
                        <nohelp>true</nohelp>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>2.7</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>2.18.1</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.18.1</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.8.2</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>2.5.2</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>2.6.1</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>3.4</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>2.6</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>2.6</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>2.16</version>
                    <configuration>
                        <logViolationsToConsole>true</logViolationsToConsole>
                        <failOnViolation>true</failOnViolation>
                        <checkstyleRules>
                            <module name="Checker">
                                <module name="TreeWalker">
                                    <module name="OneStatementPerLine" />
                                    <module name="MultipleVariableDeclarations" />
                                    <module name="MissingSwitchDefault" />
                                    <module name="AvoidStarImport" />
                                    <module name="OneTopLevelClass" />
                                    <module name="NeedBraces" />
                                    <module name="NoLineWrap" />
                                    <module name="FallThrough" />
                                    <!--
                                        not usable due to lambdas
                                        https://github.com/checkstyle/checkstyle/issues/281
                                    <module name="Indentation">
                                        <property name="basicOffset" value="4" />
                                        <property name="braceAdjustment" value="0" />
                                        <property name="caseIndent" value="4" />
                                        <property name="throwsIndent" value="4" />
                                        <property name="lineWrappingIndentation" value="4" />
                                        <property name="arrayInitIndent" value="4" />
                                    </module>
                                    -->
                                </module>
                                <module name="FileTabCharacter">
                                    <property name="eachLine" value="true" />
                                    <property name="fileExtensions" value="java" />
                                </module>
                                <module name="RegexpSingleline">
                                    <property name="format" value="\s+$" />
                                    <property name="message" value="Line contains trailing whitespace." />
                                </module>
                            </module>
                        </checkstyleRules>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>com.puppycrawl.tools</groupId>
                            <artifactId>checkstyle</artifactId>
                            <version>6.11.2</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>com.github.dantwining.whitespace-maven-plugin</groupId>
                    <artifactId>whitespace-maven-plugin</artifactId>
                    <version>1.0.4</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>sign</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
