<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~  Copyright (c) 2023 Otavio Santana
  ~
  ~  This program and the accompanying materials are made available under the
  ~  terms of the Apache License, Version 2.0 which is available at
  ~  https://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>expert.os.integration</groupId>
    <artifactId>microstream-jakarta-data</artifactId>
    <version>0.0.2</version>

    <name>Microstream Integration Jakarta persistence layers</name>
    <description>Microstream Integration aims to explore the capability of Jakarta persistence
        specifications to make your life as a Java developer easier.
    </description>
    <url>https://github.com/ultimate-engineer</url>

    <licenses>
        <license>
            <name>Apache-2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0</url>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git://github.com/ultimate-sophistication/microstream-jakarta-data.git</connection>
        <developerConnection>scm:git:ssh://github.com:ultimate-sophistication/microstream-jakarta-data.git</developerConnection>
        <url>https://github.com/ultimate-sophistication/microstream-jakarta-data</url>
    </scm>

    <developers>
        <developer>
            <name>Otavio Santana</name>
            <email>otavio@os.expert</email>
            <organization>Microstream</organization>
            <organizationUrl>https://microstream.one/</organizationUrl>
        </developer>
    </developers>


    <properties>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <microstream.version>08.00.00-MS-GA</microstream.version>
        <jakarta.data.version>1.0.0-b2</jakarta.data.version>
        <jakarta.nosql.version>1.0.0-b6</jakarta.nosql.version>
        <jnosql.query.version>1.0.0-b6</jnosql.query.version>
        <junit.version>5.9.2</junit.version>
        <mockito.version>4.11.0</mockito.version>
        <classgraph.version>4.8.151</classgraph.version>
        <maven-javadoc-plugin.vesion>3.3.2</maven-javadoc-plugin.vesion>
        <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
        <maven.compile.version>3.8.1</maven.compile.version>
        <maven.surefire.plugin.version>2.22.2</maven.surefire.plugin.version>
        <jacoco.maven.version>0.8.8</jacoco.maven.version>
        <maven.checkstyle.plugin.version>3.2.0</maven.checkstyle.plugin.version>
        <apache.rat.version>0.15</apache.rat.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>jakarta.enterprise</groupId>
            <artifactId>jakarta.enterprise.cdi-api</artifactId>
            <version>4.0.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse.microprofile.config</groupId>
            <artifactId>microprofile-config-api</artifactId>
            <version>3.0.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>io.github.classgraph</groupId>
            <artifactId>classgraph</artifactId>
            <version>${classgraph.version}</version>
        </dependency>
        <dependency>
            <groupId>one.microstream</groupId>
            <artifactId>microstream-storage-embedded</artifactId>
            <version>${microstream.version}</version>
        </dependency>
        <dependency>
            <groupId>one.microstream</groupId>
            <artifactId>microstream-storage-embedded-configuration</artifactId>
            <version>${microstream.version}</version>
        </dependency>
        <dependency>
            <groupId>one.microstream</groupId>
            <artifactId>microstream-configuration</artifactId>
            <version>${microstream.version}</version>
        </dependency>
        <dependency>
            <groupId>one.microstream</groupId>
            <artifactId>microstream-cache</artifactId>
            <version>${microstream.version}</version>
        </dependency>
        <dependency>
            <artifactId>jakarta-data-api</artifactId>
            <groupId>jakarta.data</groupId>
            <version>${jakarta.data.version}</version>
        </dependency>
        <dependency>
            <groupId>jakarta.nosql</groupId>
            <artifactId>nosql-core</artifactId>
            <version>${jakarta.nosql.version}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jnosql.communication</groupId>
            <artifactId>jnosql-communication-query</artifactId>
            <version>${jnosql.query.version}</version>
        </dependency>

        <!--Test-->
        <dependency>
            <groupId>io.smallrye.config</groupId>
            <artifactId>smallrye-config</artifactId>
            <version>3.1.1</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-params</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-junit-jupiter</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.weld</groupId>
            <artifactId>weld-junit5</artifactId>
            <version>4.0.0.Final</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>3.24.2</version>
            <scope>test</scope>
        </dependency>
    </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>
            <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-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>10.3</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>0.15</version>
                <configuration>
                    <includes>
                        <include>src/**/*.java</include>
                        <include>src/**/*.xml</include>
                        <include>pom.xml</include>
                    </includes>
                </configuration>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </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>
                <configuration>
                    <source>${maven.compiler.source}</source>
                </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>
                </configuration>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <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>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                            <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>
                                <configuration>
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>
    <repositories>
        <repository>
            <id>jakarta.sonatype.org-snapshot</id>
            <url>https://jakarta.oss.sonatype.org/content/repositories/snapshots/</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>oss.sonatype.org-snapshot</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>
</project>