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

    Copyright © 2010-2019 OddSource Code (license@oddsource.io)

    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>io.oddsource.java</groupId>
    <artifactId>oss-parent</artifactId>
    <packaging>pom</packaging>

    <name>OddSource OSS Parent</name>
    <version>2.1</version>
    <description>
        Parent POM for all OddSource Java Code projects.
    </description>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0</url>
            <distribution>repo,maven,manual</distribution>
        </license>
    </licenses>

    <url>http://oddsource.io/</url>
    <scm>
        <url>https://github.com/OddSource/java-oss-parent</url>
        <connection>scm:git:https://github.com/OddSource/java-oss-parent.git</connection>
        <developerConnection>scm:git:git@github.com:OddSource/java-oss-parent.git</developerConnection>
    </scm>
    <issueManagement>
        <system>GitHub Issues</system>
        <url>https://github.com/OddSource/java-oss-parent/issues</url>
    </issueManagement>
    <ciManagement>
        <system>Travis CI</system>
        <url>https://travis-ci.org/OddSource/java-oss-parent</url>
    </ciManagement>
    <inceptionYear>2010</inceptionYear>

    <organization>
        <name>OddSource Code</name>
        <url>http://oddsource.io/</url>
    </organization>

    <developers>
        <developer>
            <id>nicholas.williams</id>
            <name>Nick Williams</name>
            <email>nicholas@nicholaswilliams.net</email>
            <url>http://www.nicholaswilliams.net</url>
            <timezone>America/Chicago</timezone>
        </developer>
    </developers>

    <contributors>

    </contributors>

    <properties>
        <gpg.keyname>5224F049F154E1FAA46C13C37B440CA3BEB1A41F</gpg.keyname>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <sonatypeOssRepositoryBaseUrl>https://oss.sonatype.org/</sonatypeOssRepositoryBaseUrl>
        <sonatypeOssRepositorySnapshotUrl>https://oss.sonatype.org/content/repositories/snapshots</sonatypeOssRepositorySnapshotUrl>
        <sonatypeOssRepositoryStagingUrl>https://oss.sonatype.org/service/local/staging/deploy/maven2</sonatypeOssRepositoryStagingUrl>
        <version.plugin.checkstyle>3.0.0</version.plugin.checkstyle>
        <version.plugin.checksum>1.8</version.plugin.checksum>
        <version.plugin.deploy>2.8.2</version.plugin.deploy>
        <version.plugin.enforcer>1.4.1</version.plugin.enforcer>
        <version.plugin.gpg>1.6</version.plugin.gpg>
        <version.plugin.install>2.5.2</version.plugin.install>
        <version.plugin.license>3.0</version.plugin.license>
        <version.plugin.nexus>1.6.8</version.plugin.nexus>
        <version.plugin.spotbugs>3.1.8</version.plugin.spotbugs>
    </properties>

    <repositories>
        <repository>
            <id>sonatype-nexus-snapshots</id>
            <name>Sonatype Nexus Snapshots</name>
            <url>${sonatypeOssRepositorySnapshotUrl}</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

    <distributionManagement>
        <snapshotRepository>
            <id>sonatype-nexus-snapshots</id>
            <name>Sonatype Nexus Snapshot Repository</name>
            <url>${sonatypeOssRepositorySnapshotUrl}</url>
        </snapshotRepository>
        <repository>
            <id>sonatype-nexus-staging</id>
            <name>Sonatype Nexus Release-Staging Repository</name>
            <url>${sonatypeOssRepositoryStagingUrl}</url>
        </repository>
    </distributionManagement>

    <build>
        <sourceDirectory>source/production/java</sourceDirectory>
        <resources>
            <resource>
                <directory>source/production/resources</directory>
            </resource>
        </resources>

        <testSourceDirectory>source/test/java</testSourceDirectory>
        <testResources>
            <testResource>
                <directory>source/test/resources</directory>
            </testResource>
        </testResources>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.github.spotbugs</groupId>
                    <artifactId>spotbugs-maven-plugin</artifactId>
                    <version>${version.plugin.spotbugs}</version>
                    <inherited>true</inherited>
                    <configuration>
                        <effort>Max</effort>
                        <threshold>Low</threshold>
                        <xmlOutput>true</xmlOutput>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>${version.plugin.enforcer}</version>
                    <inherited>true</inherited>
                    <executions>
                        <execution>
                            <id>enforce-maven</id>
                            <goals>
                                <goal>display-info</goal>
                                <goal>enforce</goal>
                            </goals>
                            <configuration>
                                <rules>
                                    <requireMavenVersion>
                                        <version>[3.0.5,4.0)</version>
                                    </requireMavenVersion>
                                    <requireJavaVersion>
                                        <version>[1.8,1.9),[1.10,1.12),[8.0,9),[10.0,12)</version>
                                    </requireJavaVersion>
                                </rules>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>${version.plugin.checkstyle}</version>
                    <inherited>true</inherited>
                    <dependencies>
                        <dependency>
                            <groupId>com.puppycrawl.tools</groupId>
                            <artifactId>checkstyle</artifactId>
                            <version>8.16</version>
                        </dependency>
                    </dependencies>
                    <configuration>
                        <checkstyleRules>
                            <module name="Checker">
                                <module name="FileLength">
                                    <property name="max" value="1500" />
                                </module>
                                <module name="FileTabCharacter" />
                                <module name="JavadocPackage" />
                                <module name="NewlineAtEndOfFile" />
                                <module name="TreeWalker">
                                    <module name="AbbreviationAsWordInName">
                                        <property name="ignoreFinal" value="true" />
                                        <property name="ignoreStatic" value="true" />
                                        <property name="allowedAbbreviationLength" value="0" />
                                        <property name="allowedAbbreviations" value="CSV,DSA,FTP,HTML,HTTP,HTTPS,IP,RSA,SCP,SFTP,SMTP,SMTPS,SSH,TCP,TSV,UDP,UID,URI,URL,XML,YML,YAML" />
                                    </module>
                                    <module name="AnnotationLocation">
                                        <property name="allowSamelineMultipleAnnotations" value="false" />
                                        <property name="allowSamelineParameterizedAnnotation" value="true" />
                                        <property name="allowSamelineSingleParameterlessAnnotation" value="true" />
                                    </module>
                                    <module name="AnonInnerLength" />
                                    <module name="ArrayTrailingComma" />
                                    <module name="AtclauseOrder">
                                        <property name="tagOrder" value="@param,@return,@throws,@exception,@see,@serial,@serialField,@serialData,@deprecated,@author,@version,@since"/>
                                    </module>
                                    <module name="AvoidNestedBlocks" />
                                    <module name="AvoidStarImport" />
                                    <module name="AvoidStaticImport" />
                                    8.1.6 <module name="ClassMemberImpliedModifier" />
                                    <module name="CovariantEquals" />
                                    <module name="CustomImportOrder">
                                        <property name="customImportOrderRules"
                                                  value="STATIC###STANDARD_JAVA_PACKAGE###THIRD_PARTY_PACKAGE###SAME_PACKAGE(3)" />
                                        <property name="separateLineBetweenGroups" value="true" />
                                        <property name="sortImportsInGroupAlphabetically" value="true" />
                                    </module>
                                    <module name="DeclarationOrder">
                                        <!--Static variables, instance variables, constructors, methods-->
                                    </module>
                                    <module name="DefaultComesLast" />
                                    <module name="EmptyBlock" />
                                    <module name="EmptyCatchBlock">
                                        <property name="exceptionVariableName" value="expected|ignore" />
                                    </module>
                                    <module name="EmptyLineSeparator">
                                        <property name="tokens" value="CLASS_DEF,CTOR_DEF,ENUM_DEF,IMPORT,INSTANCE_INIT,INTERFACE_DEF,METHOD_DEF,STATIC_IMPORT,STATIC_INIT,VARIABLE_DEF" />
                                    </module>
                                    <module name="EmptyStatement" />
                                    <module name="EqualsAvoidNull" />
                                    <module name="EqualsHashCode" />
                                    <module name="ExecutableStatementCount">
                                        <property name="max" value="50" />
                                    </module>
                                    <module name="ExplicitInitialization" />
                                    <module name="FallThrough" />
                                    <module name="FinalClass" />
                                    <module name="FinalLocalVariable" />
                                    <module name="FinalParameters" />
                                    <module name="GenericWhitespace" />
                                    <module name="HideUtilityClassConstructor" />
                                    <module name="IllegalCatch" />
                                    <module name="IllegalImport" />
                                    <module name="IllegalThrows" />
                                    <module name="InnerAssignment" />
                                    <module name="InnerTypeLast" />
                                    <module name="InterfaceIsType">
                                        <property name="allowMarkerInterfaces" value="true" />
                                    </module>
                                    <module name="InterfaceMemberImpliedModifier" />
                                    <module name="JavadocMethod">
                                        <property name="scope" value="protected" />
                                    </module>
                                    <module name="JavadocParagraph">
                                        <property name="allowNewlineParagraph" value="true" />
                                    </module>
                                    <module name="JavadocStyle">
                                        <property name="scope" value="protected" />
                                    </module>
                                    <module name="JavadocTagContinuationIndentation" />
                                    <module name="JavadocType">
                                        <property name="scope" value="protected" />
                                    </module>
                                    <module name="JavadocVariable">
                                        <property name="scope" value="public" />
                                    </module>
                                    <module name="LeftCurly">
                                        <property name="ignoreEnums" value="false" />
                                        <property name="option" value="nl" />
                                        <!--Everything except lambdas-->
                                        <property name="tokens"
                                                  value="ANNOTATION_DEF,CLASS_DEF,CTOR_DEF,ENUM_CONSTANT_DEF,ENUM_DEF,INTERFACE_DEF,LITERAL_CASE,LITERAL_CATCH,LITERAL_DEFAULT,LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_FOR,LITERAL_IF,LITERAL_SWITCH,LITERAL_SYNCHRONIZED,LITERAL_TRY,LITERAL_WHILE,METHOD_DEF,OBJBLOCK,STATIC_INIT" />
                                    </module>
                                    <module name="LeftCurly">
                                        <property name="ignoreEnums" value="true" />
                                        <property name="option" value="eol" />
                                        <property name="tokens" value="LAMBDA" />
                                    </module>
                                    <module name="LineLength">
                                        <property name="max" value="120" />
                                    </module>
                                    <module name="MagicNumber">
                                        <property name="ignoreAnnotation" value="true" />
                                        <property name="ignoreHashCodeMethod" value="true" />
                                    </module>
                                    <module name="MethodLength">
                                        <property name="max" value="50" />
                                    </module>
                                    <module name="MethodParamPad">
                                        <property name="allowLineBreaks" value="false" />
                                        <property name="option" value="nospace" />
                                    </module>
                                    <module name="MissingCtor" />
                                    <module name="MissingSwitchDefault" />
                                    <module name="ModifiedControlVariable">
                                        <property name="skipEnhancedForLoopVariable" value="true" />
                                    </module>
                                    <module name="MultipleStringLiterals" />
                                    <module name="MultipleVariableDeclarations" />
                                    <module name="MutableException" />
                                    <module name="NeedBraces" />
                                    <module name="NestedForDepth">
                                        <property name="max" value="2" />
                                    </module>
                                    <module name="NestedIfDepth">
                                        <property name="max" value="2" />
                                    </module>
                                    <module name="NestedTryDepth">
                                        <property name="max" value="2" />
                                    </module>
                                    <module name="NonEmptyAtclauseDescription" />
                                    <module name="NoWhitespaceAfter">
                                        <property name="allowLineBreaks" value="false" />
                                        <property name="tokens" value="AT,BNOT,DEC,INC,LITERAL_SYNCHRONIZED,LNOT" />
                                    </module>
                                    <module name="NoWhitespaceAfter">
                                        <property name="allowLineBreaks" value="true" />
                                        <property name="tokens"
                                                  value="ARRAY_DECLARATOR,ARRAY_INIT,DOT,INDEX_OP,METHOD_REF,UNARY_MINUS,UNARY_PLUS" />
                                    </module>
                                    <module name="NoWhitespaceBefore">
                                        <property name="allowLineBreaks" value="false" />
                                        <property name="tokens" value="COMMA,DOT,ELLIPSIS,METHOD_REF,POST_INC,POST_DEC,SEMI" />
                                    </module>
                                    <module name="NoWhitespaceBefore">
                                        <property name="allowLineBreaks" value="true" />
                                        <property name="tokens" value="GENERIC_END,GENERIC_START" />
                                    </module>
                                    <module name="OneStatementPerLine" />
                                    <module name="OneTopLevelClass" />
                                    <module name="OperatorWrap">
                                        <property name="option" value="eol" />
                                    </module>
                                    <module name="OuterTypeFilename" />
                                    <module name="OuterTypeNumber" />
                                    <module name="OverloadMethodsDeclarationOrder" />
                                    <module name="PackageDeclaration">
                                        <property name="matchDirectoryStructure" value="true" />
                                    </module>
                                    <module name="ParameterAssignment" />
                                    <module name="ParameterNumber">
                                        <property name="max" value="10" />
                                    </module>
                                    <module name="ParenPad">
                                        <property name="option" value="nospace" />
                                    </module>
                                    <module name="RedundantImport" />
                                    <module name="RequireThis" />
                                    <module name="ReturnCount">
                                        <property name="max" value="3" />
                                        <property name="maxForVoid" value="3" />
                                    </module>
                                    <module name="RightCurly">
                                        <property name="option" value="alone" />
                                    </module>
                                    <module name="SeparatorWrap">
                                        <property name="option" value="eol" />
                                    </module>
                                    <module name="SimplifyBooleanExpression" />
                                    <module name="SimplifyBooleanReturn" />
                                    <module name="SingleSpaceSeparator">
                                        <property name="validateComments" value="false" />
                                    </module>
                                    <module name="StringLiteralEquality" />
                                    <module name="SuperClone" />
                                    <module name="SuperFinalize" />
                                    <module name="ThrowsCount">
                                        <property name="ignorePrivateMethods" value="true" />
                                        <property name="max" value="4" />
                                    </module>
                                    <module name="TypecastParenPad">
                                        <property name="option" value="nospace" />
                                    </module>
                                    <module name="UnnecessaryParentheses" />
                                    <module name="UnusedImports" />
                                    <module name="VariableDeclarationUsageDistance" />
                                    <module name="VisibilityModifier">
                                        <property name="allowPublicImmutableFields" value="true" />
                                    </module>
                                    <module name="WhitespaceAfter">
                                        <property name="tokens" value="COMMA,SEMI,TYPECAST"/>
                                    </module>
                                </module>
                            </module>
                        </checkstyleRules>
                        <consoleOutput>true</consoleOutput>
                        <failOnViolation>true</failOnViolation>
                        <failsOnError>false</failsOnError>
                        <includeResources>true</includeResources>
                        <includes>**\/*.java</includes>
                        <includeTestResources>true</includeTestResources>
                        <includeTestSourceDirectory>true</includeTestSourceDirectory>
                        <logViolationsToConsole>true</logViolationsToConsole>
                        <resourceIncludes>**\/*.properties</resourceIncludes>
                        <suppressionsLocation>build/checkstyle-suppressions.xml</suppressionsLocation>
                        <violationSeverity>warning</violationSeverity>
                    </configuration>
                    <executions>
                        <execution>
                            <id>verify-style</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>${version.plugin.license}</version>
                    <inherited>true</inherited>
                    <configuration>
                        <excludes>
                            <exclude>**/*.enc</exclude>
                            <exclude>**/*.key</exclude>
                            <exclude>**/*.rst</exclude>
                            <exclude>**/*.txt</exclude>
                            <exclude>**/.gitkeep</exclude>
                        </excludes>
                        <header>com/mycila/maven/plugin/license/templates/APACHE-2.txt</header>
                        <mapping>
                            <c>SLASHSTAR_STYLE</c>
                            <cpp>SLASHSTAR_STYLE</cpp>
                            <groovy>SLASHSTAR_STYLE</groovy>
                            <h>SLASHSTAR_STYLE</h>
                            <java>SLASHSTAR_STYLE</java>
                            <yaml>SCRIPT_STYLE</yaml>
                            <yml>SCRIPT_STYLE</yml>
                        </mapping>
                        <properties>
                            <owner>OddSource Code</owner>
                            <email>license@oddsource.io</email>
                            <project.inceptionYear>2010-2019</project.inceptionYear>
                        </properties>
                    </configuration>
                    <executions>
                        <execution>
                            <id>verify-license</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>${version.plugin.gpg}</version>
                    <inherited>true</inherited>
                    <configuration>
                        <!--Uncomment the following (and remove the extra space between hyphens) for GnuPG >= 2.1-->
                        <!--<gpgArguments>
                            <arg>- -pinentry-mode</arg>
                            <arg>loopback</arg>
                        </gpgArguments>-->
                        <keyname>${gpg.keyname}</keyname>
                        <passphraseServerId>${gpg.keyname}</passphraseServerId>
                    </configuration>
                    <executions>
                        <execution>
                            <id>sign-artifacts</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <!--At a future date we'll need to use this, because the upcoming version of maven-install-plugin
                    does not create checksums. However, right now this plugin does not work. We may have to roll our
                    own.-->
                <!--<plugin>
                    <groupId>net.nicoulaj.maven.plugins</groupId>
                    <artifactId>checksum-maven-plugin</artifactId>
                    <version>${version.plugin.checksum}</version>
                    <inherited>true</inherited>
                    <configuration>
                        <algorithms>
                            <algorithm>MD5</algorithm>
                            <algorithm>SHA-1</algorithm>
                        </algorithms>
                        <attachChecksums>true</attachChecksums>
                        <failOnError>true</failOnError>
                    </configuration>
                    <executions>
                        <execution>
                            <id>checksum-artifacts</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>artifacts</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>-->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>${version.plugin.install}</version>
                    <inherited>true</inherited>
                    <configuration>
                        <createChecksum>true</createChecksum>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>${version.plugin.deploy}</version>
                    <inherited>true</inherited>
                    <configuration>
                        <skip>true</skip>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>${version.plugin.nexus}</version>
                    <inherited>true</inherited>
                    <configuration>
                        <serverId>ossrh</serverId>
                        <nexusUrl>${sonatypeOssRepositoryBaseUrl}</nexusUrl>
                        <stagingProfileId>923db7f780e30f</stagingProfileId>
                    </configuration>
                    <executions>
                        <execution>
                            <id>default-deploy</id>
                            <phase>deploy</phase>
                            <goals>
                                <goal>deploy</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>com.github.spotbugs</groupId>
                <artifactId>spotbugs-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>

        </plugins>
    </reporting>

    <profiles>
        <profile>
            <id>sign</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                    </plugin>
                    <!--See comment above -->
                    <!--<plugin>
                        <groupId>net.nicoulaj.maven.plugins</groupId>
                        <artifactId>checksum-maven-plugin</artifactId>
                    </plugin>-->
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
