<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2019 Otavio Santana and others
  ~
  ~ This program and the accompanying materials are made available under the
  ~ terms of the Eclipse Public License v. 2.0 which is available at
  ~ http://www.eclipse.org/legal/epl-2.0.
  ~
  -->
<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.eclipse.ee4j</groupId>
        <artifactId>project</artifactId>
        <version>1.0.9</version>
    </parent>

    <groupId>jakarta.nosql</groupId>
    <artifactId>jakarta.nosql-parent</artifactId>
    <version>1.0.0</version>
    <packaging>pom</packaging>

    <name>Jakarta NoSQL</name>
    <description>Jakarta NoSQL is a Java framework that streamlines the integration of Java applications with NoSQL databases.</description>
    <url>www.eclipse.org/ee4j/nosql</url>


    <licenses>
        <license>
            <name>Eclipse Public License 2.0</name>
            <url>https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt</url>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git://github.com/jakartaee/nosql.git</connection>
        <developerConnection>scm:git:ssh://github.com:jakartaee/nosql.git</developerConnection>
        <url>https://github.com/jakartaee/nosql</url>
    </scm>

    <developers>
        <developer>
            <name>Jakarta NoSQL Developers</name>
            <email>nosql-dev@eclipse.org</email>
            <organization>Eclipse JakartaNoSQL</organization>
            <organizationUrl>https://accounts.eclipse.org/mailing-list/nosql-dev</organizationUrl>
        </developer>
    </developers>

    <properties>
        <spec.version>1.0</spec.version>
        <apache.rat.version>0.15</apache.rat.version>
        <checkstyle.excludes></checkstyle.excludes>
        <jacoco.maven.version>0.8.12</jacoco.maven.version>
        <maven-javadoc-plugin.version>3.11.1</maven-javadoc-plugin.version>
        <maven.checkstyle.plugin.version>3.5.0</maven.checkstyle.plugin.version>
        <maven.compile.version>3.14.0</maven.compile.version>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <maven.surefire.plugin.version>3.5.2</maven.surefire.plugin.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <sonar.jacoco.reportPath>../target/jacoco.exec</sonar.jacoco.reportPath>
        <sonar.maven.version>5.0.0.4389</sonar.maven.version>
        <maven-gpg-plugin.version>3.1.0</maven-gpg-plugin.version>
        <apache.pdm.plugin.version>3.24.0</apache.pdm.plugin.version>
        <checkstyle.version>10.21.1</checkstyle.version>
        <maven-source-plugin.version>3.3.1</maven-source-plugin.version>
    </properties>

    <dependencies>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven.compile.version}</version>
                <configuration>
                    <target>${maven.compiler.target}</target>
                    <source>${maven.compiler.source}</source>
                </configuration>
            </plugin>
            <!-- Disable when move it to staging -->
            <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-javadoc-plugin</artifactId>
                <version>${maven-javadoc-plugin.version}</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <source>${maven.compiler.source}</source>
                    <doctitle>Jakarta NoSQL API documentation</doctitle>
                    <windowtitle>Jakarta NoSQL API documentation</windowtitle>
                    <header><![CDATA[<br>Jakarta NoSQL API v${spec.version}]]></header>
                    <bottom><![CDATA[
Comments to: <a href="mailto:nosql-dev@eclipse.org">nosql-dev@eclipse.org</a>.<br>
Copyright &#169; 2025 Eclipse Foundation. All rights reserved.<br>]]>
                    </bottom>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven.surefire.plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco.maven.version}</version>
                <executions>
                    <execution>
                        <id>prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </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>
                <executions>
                    <execution>
                        <id>verify-style</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <excludes>**/module-info.java,${checkstyle.excludes}</excludes>
                    <logViolationsToConsole>true</logViolationsToConsole>
                    <consoleOutput>true</consoleOutput>
                    <checkstyleRules>
                        <module name="Checker">

                            <module name="FileLength">
                                <property name="max" value="3500"/>
                                <property name="fileExtensions" value="java"/>
                            </module>

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

                            <module name="FileTabCharacter"/>

                            <module name="TreeWalker">
                                <module name="SuppressionCommentFilter"/>
                                <module name="ConstantName">
                                    <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>

                                <module name="AvoidStarImport">
                                    <property name="excludes"
                                              value="java.io,java.net,java.util,jakarta.enterprise.inject.spi,jakarta.enterprise.context"/>
                                </module>
                                <module name="IllegalImport"/>
                                <module name="RedundantImport"/>
                                <module name="UnusedImports"/>

                                <module name="MethodLength">
                                    <property name="max" value="250"/>
                                </module>
                                <module name="ParameterNumber">
                                    <property name="max" value="15"/>
                                </module>

                                <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>

                                <module name="EmptyStatement"/>
                                <module name="EqualsHashCode"/>
                                <module name="DefaultComesLast"/>
                                <module name="MissingSwitchDefault"/>
                                <module name="FallThrough"/>
                                <module name="MultipleVariableDeclarations"/>

                                <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>${apache.rat.version}</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>EPL-2.0</licenseFamilyCategory>
                            <licenseFamilyName>Eclipse Public License 2.0</licenseFamilyName>
                            <patterns>
                                <pattern>Eclipse Public License v. 2.0</pattern>
                            </patterns>
                        </license>
                    </licenses>
                    <licenseFamilies>
                        <licenseFamily implementation="org.apache.rat.license.SimpleLicenseFamily">
                            <familyName>Eclipse Public License 2.0</familyName>
                        </licenseFamily>
                    </licenseFamilies>
                </configuration>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <version>${apache.pdm.plugin.version}</version>
                <configuration>
                    <rulesets>
                        <ruleset>pmd/pmd-rules.xml</ruleset>
                    </rulesets>
                    <failOnViolation>true</failOnViolation>
                    <printFailingErrors>true</printFailingErrors>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.sonarsource.scanner.maven</groupId>
                    <artifactId>sonar-maven-plugin</artifactId>
                    <version>${sonar.maven.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.13</version>
                        <extensions>true</extensions>
                        <configuration>
                            <nexusUrl>https://jakarta.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>${maven-gpg-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <modules>
        <module>api</module>
        <module>tck</module>
        <module>spec</module>
    </modules>
</project>
