<?xml version="1.0" encoding="UTF-8"?>
<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.github.n1ckl0sk0rtge</groupId>
    <artifactId>app-bootstrap-core</artifactId>
    <version>1.1.0</version>

    <name>app-bootstrap-core</name>
    <description>
        A lightweight Java framework enabling Clean Architecture, CQRS, and DDD tactical patterns.
    </description>
    <url>https://github.com/n1ckl0sk0rtge/app-bootstrap-core</url>

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

    <developers>
        <developer>
            <id>n1ckl0sk0rtge</id>
            <name>Nicklas Koertge</name>
            <email>nicklas.koertge@protonmail.com</email>
            <roles>
                <role>Architect</role>
                <role>Developer</role>
            </roles>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:https://github.com/n1ckl0sk0rtge/app-bootstrap-core.git</connection>
        <url>https://github.com/n1ckl0sk0rtge/app-bootstrap-core.git</url>
        <developerConnection>scm:git:https://github.com/n1ckl0sk0rtge/app-bootstrap-core.git</developerConnection>
    </scm>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/n1ckl0sk0rtge/app-bootstrap-core/issues</url>
    </issueManagement>

    <ciManagement>
        <system>GitHub-Actions</system>
        <url>https://github.com/n1ckl0sk0rtge/app-bootstrap-core/actions</url>
    </ciManagement>

    <properties>
        <maven.compiler.release>21</maven.compiler.release>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <compiler-plugin.version>3.14.1</compiler-plugin.version>

        <junit.jupiter.version>5.13.4</junit.jupiter.version>
        <google-java-format.version>1.28.0</google-java-format.version>

        <errorprone.version>2.47.0</errorprone.version>
        <nullaway.version>0.13.1</nullaway.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>jakarta.annotation</groupId>
            <artifactId>jakarta.annotation-api</artifactId>
            <version>3.0.0</version>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>${junit.jupiter.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${junit.jupiter.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.platform</groupId>
            <artifactId>junit-platform-launcher</artifactId>
            <version>1.13.4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>3.27.7</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                    <appendAssemblyId>false</appendAssemblyId>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id> <!-- this is used for inheritance merges -->
                        <phase>package</phase> <!-- bind to the packaging phase -->
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.3.1</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>3.12.0</version>
                <configuration>
                    <additionalJOption>-Xdoclint:none</additionalJOption>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>3.2.8</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>

            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <version>0.9.0</version>
                <extensions>true</extensions>
                <configuration>
                    <publishingServerId>central</publishingServerId>
                    <autoPublish>true</autoPublish>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${compiler-plugin.version}</version>
                <configuration>
                    <parameters>true</parameters>
                </configuration>
                <executions>
                    <execution>
                        <id>default-compile</id>
                        <configuration>
                            <compilerArgs>
                                <arg>-Xlint:deprecation</arg>
                                <arg>-Xlint:unchecked</arg>
                                <arg>-XDcompilePolicy=simple</arg>
                                <arg>--should-stop=ifError=FLOW</arg>
                                <arg>-Xplugin:ErrorProne -Xep:NullAway:ERROR -XepOpt:NullAway:AnnotatedPackages=com.ibm</arg>
                                <!-- necessary only if building with JDK21: https://github.com/google/error-prone/issues/5426 -->
                                <arg>-XDaddTypeAnnotationsToSymbol=true</arg>
                            </compilerArgs>
                            <annotationProcessorPaths>
                                <path>
                                    <groupId>com.google.errorprone</groupId>
                                    <artifactId>error_prone_core</artifactId>
                                    <version>${errorprone.version}</version>
                                </path>
                                <path>
                                    <groupId>com.uber.nullaway</groupId>
                                    <artifactId>nullaway</artifactId>
                                    <version>${nullaway.version}</version>
                                </path>
                            </annotationProcessorPaths>
                        </configuration>
                    </execution>
                    <execution>
                        <id>default-testCompile</id>
                        <configuration>
                            <compilerArgs>
                                <arg>-Xlint:deprecation</arg>
                                <arg>-Xlint:unchecked</arg>
                            </compilerArgs>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.diffplug.spotless</groupId>
                <artifactId>spotless-maven-plugin</artifactId>
                <version>2.46.1</version>
                <configuration>
                    <java>
                        <includes>
                            <include>src/main/java/**/*.java</include> <!-- Check application code -->
                            <include>src/test/java/**/*.java</include> <!-- Check application tests code -->
                        </includes>
                        <googleJavaFormat>
                            <version>${google-java-format.version}</version>
                            <style>AOSP</style>
                        </googleJavaFormat>
                        <importOrder /> <!-- standard import order -->
                        <removeUnusedImports /> <!-- self-explanatory -->
                        <formatAnnotations /> <!-- fixes formatting of type annotations -->
                        <licenseHeader> <!-- specify either content or file, but not both -->
                            <content>/*
 * App Bootstrap Core
 * Copyright (C) $YEAR
 *
 * 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
 *
 *      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.
 */</content>  <!-- or <file>${project.basedir}/license-header</file> -->
                        </licenseHeader>
                    </java>
                </configuration>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>apply</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>3.6.0</version>
                <configuration>
                    <includeResources>false</includeResources>
                    <includeTestResources>false</includeTestResources>
                    <checkstyleRules>
                        <module name="Checker">
                            <property name="localeLanguage" value="en" />
                            <module name="TreeWalker">
                                <module name="IllegalImport" />
                                <module name="RedundantImport" />
                                <module name="UnusedImports" />
                                <module name="PackageName">
                                    <property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$" />
                                </module>
                                <module name="FinalClass" />
                                <module name="MissingOverride" />
                                <module name="AvoidDoubleBraceInitialization" />
                                <module name="AvoidEscapedUnicodeCharacters" />
                                <module name="BooleanExpressionComplexity">
                                    <property name="max" value="5" />
                                </module>
                                <module name="DefaultComesLast" />
                                <module name="FallThrough" />
                                <module name="InnerAssignment" />
                                <module name="LambdaParameterName">
                                    <property name="format" value="^[a-z]([a-zA-Z0-9]+)*$" />
                                </module>
                                <module name="OneStatementPerLine" />
                                <module name="UnusedLocalVariable" />
                            </module>
                        </module>
                    </checkstyleRules>
                    <excludes>**/module-info.java</excludes>
                </configuration>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>