<?xml version="1.0" encoding="UTF-8"?>
<!--
  /**
   * Licensed to the Apache Software Foundation (ASF) under one
   * or more contributor license agreements. See the NOTICE file
   * distributed with this work for additional information
   * regarding copyright ownership. The ASF 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/xsd/maven-4.0.0.xsd">

  <modelVersion>4.0.0</modelVersion>

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

  <groupId>org.tomitribe</groupId>
  <artifactId>oss-parent</artifactId>
  <packaging>pom</packaging>
  <version>6</version>

  <name>Tomitribe :: Open Source Parent POM</name>
  <url>http://www.tomitribe.com/</url>
  <organization>
    <name>Tomitribe Corporation</name>
    <url>http://www.tomitribe.com/</url>
  </organization>
  <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>
  <inceptionYear>2014</inceptionYear>

  <scm>
    <connection>scm:git:git@github.com:tomitribe/tomitribe-oss-parent.git</connection>
    <url>scm:git:git@github.com:tomitribe/tomitribe-oss-parent.git</url>
    <developerConnection>scm:git:git@github.com:tomitribe/tomitribe-oss-parent.git</developerConnection>
    <tag>oss-parent-6</tag>
  </scm>

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

    <!--WARNING: Never reference these properties outside of this pom, especially not in children-->
    <maven.checkstyle.plugin.version>2.17</maven.checkstyle.plugin.version>
  </properties>

  <build>
    <pluginManagement>
      <plugins>
        <!-- set versions of common plugins for reproducibility, ordered alphabetically -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-antrun-plugin</artifactId>
          <version>1.8</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-clean-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.5.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-enforcer-plugin</artifactId>
          <version>1.4.1</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-jar-plugin</artifactId>
          <version>2.6</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>2.10.3</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>2.5.3</version>
        </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-source-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.19.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-shade-plugin</artifactId>
          <version>2.4.3</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <!--
        - Make a checkstyle violation a compile error. Note that if a compile error occurs,
        - further information can be found in target/site/checkstyle.html (present even when
        - just the compile goal and not the site goal has been run). Note also that child
        - projects may redeclare this plugin and provide different configuration settings
        - to use different checks (more or less strict than the default).

      -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>${maven.checkstyle.plugin.version}</version>
        <executions>
          <execution>
            <id>verify-style</id>
            <phase>process-classes</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <logViolationsToConsole>true</logViolationsToConsole>
          <checkstyleRules>
            <module name="Checker">
              <module name="SuppressionCommentFilter" />

              <!-- Checks for Size Violations.                    -->
              <!-- See http://checkstyle.sf.net/config_sizes.html -->
              <module name="FileLength">
                <property name="max" value="3500" />
                <property name="fileExtensions" value="java" />
              </module>

              <!-- Checks for whitespace                               -->
              <!-- See http://checkstyle.sf.net/config_whitespace.html -->
              <module name="FileTabCharacter" />

              <!-- allow usage of CHECKSTYLE:OFF and CHECKSTYLE:ON -->
              <module name="SuppressionCommentFilter" />

              <module name="TreeWalker">
                <!-- needed for the SuppressionCommentFilter -->
                <module name="FileContentsHolder" />

                <!-- Checks for Naming Conventions.                  -->
                <!-- See http://checkstyle.sf.net/config_naming.html -->
                <module name="ConstantName">
                  <!-- 0=Allowed, 1=Disallowed  (see checkConstants.sh in pom source tree)
                    0 foo
                    0 fooBar
                    0 fooBarBaz
                    0 FOO
                    0 FOO_BAR
                    0 FOO_BAR_BAZ
                    0 _fooBar
                    0 f9
                    0 F9_C3
                    1 FooBar
                    1 foo_bar
                    1 FOO__BAR
                    1 _FOO
                    1 foo_
                    1 FOO_
                     -->
                  <property name="format" value="^(_?[a-z][a-zA-Z0-9]*|([A-Z](_?[A-Z0-9]+)*))$" />
                </module>

                <module name="LocalVariableName" />
                <module name="MethodName">
                  <property name="format" value="^_?[a-z][a-zA-Z0-9]*$" />
                </module>
                <module name="PackageName" />
                <module name="LocalFinalVariableName" />
                <module name="ParameterName" />
                <module name="StaticVariableName" />
                <module name="TypeName">
                  <property name="format" value="^_?[A-Z][a-zA-Z0-9]*$" />
                </module>

                <!-- Checks for imports                              -->
                <!-- See http://checkstyle.sf.net/config_import.html -->
                <module name="AvoidStarImport">
                  <property name="excludes" value="java.io,java.net,java.util,javax.enterprise.inject.spi,javax.enterprise.context" />
                </module>
                <module name="IllegalImport">
                  <property name="illegalPkgs" value=" sun.management, sun.usagetracker, sun.reflect, sun.launcher, sun.jar, sun.print, sun.java2d, sun.font, sun.rmi, sun.util,                   sun.instrument,                   sun.applet,                   sun.swing,                   sun.invoke,                   sun.audio,                   sun.net,                   sun.dc,                   sun.corba,                   sun.tracing,                   sun.security,                   sun.lwawt,                   sun.awt,                   " />
                </module>
                <module name="RedundantImport" />
                <module name="UnusedImports" />


                <module name="LineLength">
                  <property name="max" value="180" />
                  <property name="ignorePattern" value="@version|@see" />
                </module>
                <module name="MethodLength">
                  <property name="max" value="260" />
                </module>
                <module name="ParameterNumber">
                  <property name="max" value="10" />
                </module>

                <!-- Checks for blocks. You know, those {}'s         -->
                <!-- See http://checkstyle.sf.net/config_blocks.html -->
                <module name="EmptyBlock">
                  <property name="option" value="text" />
                </module>

                <module name="NeedBraces">
                    <property name="tokens" value="LITERAL_DO, LITERAL_ELSE, LITERAL_FOR, LITERAL_WHILE" />
                </module>
                <module name="LeftCurly">
                  <property name="option" value="EOL" />
                </module>
                <module name="RightCurly">
                  <property name="option" value="SAME" />
                </module>

                <!-- Checks for common coding problems               -->
                <!-- See http://checkstyle.sf.net/config_coding.html -->
                <module name="EmptyStatement" />
                <module name="EqualsHashCode" />
                <module name="DefaultComesLast" />
                <module name="MissingSwitchDefault" />
                <module name="MultipleVariableDeclarations" />

                <!-- Checks for class design                         -->
                <!-- See http://checkstyle.sf.net/config_design.html -->
                <module name="com.puppycrawl.tools.checkstyle.checks.design.DesignForExtensionCheck">
                  <property name="severity" value="ignore" />
                </module>

                <module name="HideUtilityClassConstructor" />

                <module name="com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck">
                  <property name="packageAllowed" value="false" />
                  <property name="protectedAllowed" value="true" />
                  <property name="publicMemberPattern" value="^serialVersionUID" />
                  <property name="severity" value="warning" />
                </module>

                <module name="UpperEll" />
              </module>

            </module>
          </checkstyleRules>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.rat</groupId>
        <artifactId>apache-rat-plugin</artifactId>
        <version>0.11</version>
        <configuration>
          <includes>
            <include>src/**/*</include>
            <include>pom.xml</include>
          </includes>
          <excludes>
            <exclude>**/*/MANIFEST.MF</exclude>
            <exclude>.git</exclude>
            <exclude>.gitignore</exclude>
            <exclude>derby.log</exclude>
            <exclude>**/META-INF/services/*</exclude>
            <exclude>**/bootstrap-*</exclude>
            <exclude>**/js/jquery-*</exclude>
            <exclude>**/*.json</exclude>
            <exclude>src/test/resources/**</exclude>
            <exclude>src/*/resources/META-INF/beans.xml</exclude>
            <!-- json can't get comments -->
          </excludes>
        </configuration>
        <executions>
          <execution>
            <phase>validate</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <optimize>true</optimize>
          <source>1.7</source>
          <target>1.7</target>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <forkCount>2C</forkCount>
          <reuseForks>false</reuseForks>
          <argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifest>
              <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
            </manifest>
          </archive>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <configuration>
          <useReleaseProfile>false</useReleaseProfile>
          <goals>deploy</goals>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>

