<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~
  ~  Copyright (c) 2017 Otávio Santana and others
  ~   All rights reserved. This program and the accompanying materials
  ~   are made available under the terms of the Eclipse Public License v1.0
  ~   and Apache License v2.0 which accompanies this distribution.
  ~   The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
  ~   and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php.
  ~
  ~   You may elect to redistribute this code under either of these licenses.
  ~
  ~   Contributors:
  ~
  ~   Otavio Santana
  ~
  -->
<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.jnosql</groupId>
    <artifactId>jnosql-parent</artifactId>
    <version>0.0.6</version>
    <packaging>pom</packaging>

    <name>JNoSQL-Parent</name>
    <description>JNoSQL parent where has the rules about license and check style.</description>
    <url>http://jnosql.org/</url>

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
        <license>
            <name>The Eclipse Public License v1.0</name>
            <url>http://www.eclipse.org/legal/epl-v10.html</url>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git://github.com/eclipse/jnosql-parent.git</connection>
        <developerConnection>scm:git:ssh://github.com:eclipse/jnosql-parent.git</developerConnection>
        <url>https://github.com/eclipse/jnosql-parent</url>
    </scm>

    <developers>
        <developer>
            <name>Otavio Santana</name>
            <email>otaviojava@apache.org</email>
            <organization>SouJava</organization>
            <organizationUrl>https://about.me/otaviojava</organizationUrl>
        </developer>
        <developer>
            <name>JNoSQL Developers</name>
            <email>jnosql-dev@eclipse.org</email>
            <organization>Eclipse JNoSQL</organization>
            <organizationUrl>https://dev.eclipse.org/mailman/listinfo/jnosql-dev</organizationUrl>
        </developer>
    </developers>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compile.targetLevel>1.8</maven.compile.targetLevel>
        <maven.compile.sourceLevel>1.8</maven.compile.sourceLevel>
        <maven.compile.version>3.5.1</maven.compile.version>

        <maven-javadoc-plugin.vesion>3.0.0</maven-javadoc-plugin.vesion>
        <maven-source-plugin.version>3.0.1</maven-source-plugin.version>
        <maven.checkstyle.plugin.version>2.17</maven.checkstyle.plugin.version>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven.compile.version}</version>
                <configuration>
                    <target>${maven.compile.targetLevel}</target>
                    <source>${maven.compile.sourceLevel}</source>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven-javadoc-plugin.vesion}</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </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</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <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>
                    <consoleOutput>true</consoleOutput>
                    <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"/>
                                <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="250"/>
                                </module>
                                <module name="ParameterNumber">
                                    <property name="max" value="15"/>
                                </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="FallThrough"/>
                                <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 name="AnnotationLocation">
                                    <property name="allowSamelineMultipleAnnotations" value="false"/>
                                    <property name="allowSamelineSingleParameterlessAnnotation" value="false"/>
                                    <property name="allowSamelineParameterizedAnnotation" value="false"/>
                                    <property name="tokens"
                                              value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF, ANNOTATION_DEF"/>
                                </module>
                            </module>
                        </module>
                    </checkstyleRules>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.rat</groupId>
                <artifactId>apache-rat-plugin</artifactId>
                <version>0.12</version>
                <configuration>
                    <includes>
                        <include>src/**/*.java</include>
                        <include>src/**/*.xml</include>
                        <include>pom.xml</include>
                    </includes>
                    <excludes>
                    </excludes>
                    <licenses>
                        <license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
                            <licenseFamilyCategory>AL20-EPL10</licenseFamilyCategory>
                            <licenseFamilyName>Apache License, 2.0 and Eclipse Public License, 1.0</licenseFamilyName>
                            <patterns>
                                <pattern>Apache License v2.0</pattern>
                                <pattern>Eclipse Public License v1.0</pattern>
                            </patterns>
                        </license>
                    </licenses>
                    <licenseFamilies>
                        <licenseFamily implementation="org.apache.rat.license.SimpleLicenseFamily">
                            <familyName>Apache License, 2.0 and Eclipse Public License, 1.0</familyName>
                        </licenseFamily>
                    </licenseFamilies>
                </configuration>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.3</version>
                        <extensions>true</extensions>
                        <configuration>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <serverId>ossrh</serverId>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

</project>
