<?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/maven-v4_0_0.xsd">
              
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.github.hypfvieh</groupId>
    <artifactId>java-utils</artifactId>
    <version>1.2.2</version>
    <packaging>jar</packaging>

    <url>https://github.com/hypfvieh/${project.artifactId}</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <junit.version>5.12.2</junit.version>
    </properties>

    <name>${project.artifactId}</name>

    <description>
        A collection of utils commonly used in my projects.
        Feel free to use it (or parts of it) in your own projects.
    </description>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.21.0</version>
            </plugin>
            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.12.0</version>
                <configuration>
                    <doclint>none</doclint>
                    <!--  required because multi-release artifact will fuck up javadoc generation -->
                    <failOnError>true</failOnError>
                    <failOnWarnings>false</failOnWarnings>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            
            <plugin>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.6.1</version>
                <executions>
                    <execution>
                        <id>enforce-versions</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                    </execution>
                </executions>

                <configuration>
                    <rules>
                        <requireMavenVersion>
                            <version>3.9.3</version>
                        </requireMavenVersion>
                    </rules>
                </configuration>                
            </plugin>
            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.14.0</version>
                <configuration>
                    <release>11</release>
                </configuration>
            </plugin>
            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.4.2</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>                            
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.5.4</version>
                <configuration>
                    <failIfNoTests>false</failIfNoTests>
                    <trimStackTrace>false</trimStackTrace>
                    <printSummary>true</printSummary>
                    <testFailureIgnore>false</testFailureIgnore>

                    <forkCount>1</forkCount>
                    <reuseForks>true</reuseForks>
                    <forkedProcessTimeoutInSeconds>1800</forkedProcessTimeoutInSeconds>

                </configuration>
            </plugin>
            
            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <version>0.8.0</version>
                <extensions>true</extensions>
                <configuration>
                    <skipPublishing>false</skipPublishing>
                    <publishingServerId>central</publishingServerId>
                    <autoPublish>true</autoPublish>
                    <waitUntil>validated</waitUntil>
                    <failOnBuildFailure>true</failOnBuildFailure>
                    <checksums>all</checksums>
                </configuration>
            </plugin>
            
        </plugins>
    </build>


    <dependencies>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>2.0.17</version>
        </dependency>

	    <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>2.0.17</version>
            <scope>test</scope>
        </dependency>
        
        <dependency>
            <groupId>jakarta.persistence</groupId>
            <artifactId>jakarta.persistence-api</artifactId>
            <version>3.0.0</version>
            <optional>true</optional>
            <scope>provided</scope>
        </dependency>

        <!-- Testing stuff -->
        <!-- JUnit testing framework. -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</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.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.platform</groupId>
            <artifactId>junit-platform-launcher</artifactId>
            <version>1.12.2</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <scm>
        <connection>scm:git:ssh://git@github.com/hypfvieh/java-utils.git</connection>
        <developerConnection>scm:git:ssh://git@github.com/hypfvieh/java-utils.git</developerConnection>
        <url>ssh://git@github.com/hypfvieh/java-utils.git</url>
      <tag>java-utils-1.2.2</tag>
  </scm>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>https://github.com/hypfvieh/${project.artifactId}/blob/master/LICENSE</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>hypfvieh</id>
            <name>David M.</name>
            <email>hypfvieh@googlemail.com</email>
        </developer>
    </developers>

    <distributionManagement>
        <snapshotRepository>
            <id>central</id>
            <name>Sonatype Central Snapshots</name>
            <url>https://central.sonatype.com/repository/maven-snapshots/</url>
        </snapshotRepository>
        <repository>
            <id>central</id>
            <name>Sonatype Central Staging Repository</name>
            <url>https://central.sonatype.com</url>
        </repository>
        <site>
          <id>local</id>
          <url>file://${java.io.tmpdir}/site-prepared</url>
        </site>
    </distributionManagement>

    <profiles>
        <profile>
            <id>release</id>
            
            <properties>
                <gpg.executable>gpg2</gpg.executable>
            </properties>
            
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-release-plugin</artifactId>
                        <version>3.1.1</version>
                        <configuration>
                            <autoVersionSubmodules>true</autoVersionSubmodules>
                            <releaseProfiles>release</releaseProfiles>
                            <goals>deploy</goals>
                        </configuration>
                    </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-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <configuration>
                             <doclint>none</doclint>
                        </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>install</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
