java-library-parent
Used in:
components
- OverviewOverview
- VersionsVersions
- DependentsDependents
- DependenciesDependencies
<dependency>
<groupId>dev.mohterbaord</groupId>
<artifactId>java-library-parent</artifactId>
<version>8.0</version>
</dependency><?xml version="1.0" encoding="UTF-8"?>
<!-- SPDX-FileCopyrightText: 2026 Sergei Sokolov <mohterbaord@gmail.com> -->
<!-- SPDX-License-Identifier: Apache-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>dev.mohterbaord</groupId>
<artifactId>maven-parent</artifactId>
<version>16.0</version>
</parent>
<artifactId>java-library-parent</artifactId>
<version>8.0</version>
<packaging>pom</packaging>
<name>Java Library Parent</name>
<description>Build profiles parent POM for modern Java libraries</description>
<url>https://codeberg.org/mohterbaord/java-library-parent</url>
<organization>
<name>Sergei Sokolov</name>
<url>https://mohterbaord.dev</url>
</organization>
<inceptionYear>2026</inceptionYear>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>
<developers>
<developer>
<id>mohterbaord</id>
<name>Sergei Sokolov</name>
<email>mohterbaord@gmail.com</email>
<url>https://mohterbaord.dev</url>
<roles>
<role>Project lead</role>
<role>Developer</role>
<role>Maintainer</role>
</roles>
</developer>
</developers>
<scm>
<url>https://codeberg.org/mohterbaord/java-library-parent</url>
<connection>scm:git:https://codeberg.org/mohterbaord/java-library-parent.git</connection>
<developerConnection>scm:git:ssh://git@codeberg.org/mohterbaord/java-library-parent.git</developerConnection>
<tag>8.0</tag>
</scm>
<properties>
<!-- NOTE:
Path to license header; used by Spotless to check/update Java sources
license headers.
-->
<resource.license-header-java>${maven.multiModuleProjectDirectory}/rc/license-header-java</resource.license-header-java>
</properties>
<profiles>
<!-- NOTE:
Profiles starting with "general" are intended for use in child projects.
-->
<!-- TODO: move to maven-parent -->
<profile>
<id>general:versions</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<configuration>
<includeParent>false</includeParent>
<ruleSet>
<ignoreVersions>
<ignoreVersion>
<type>regex</type>
<version>.+-(SNAPSHOT|M\d+)</version>
</ignoreVersion>
<ignoreVersion>
<type>regex</type>
<version>.+-(alpha|beta).*</version>
</ignoreVersion>
</ignoreVersions>
</ruleSet>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<!-- NOTE:
Profiles starting with "java-library" are intended for use in child
projects.
-->
<profile>
<id>java-library:build</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>java-library:quality</id>
<properties>
<jacocoCodeCoverage>90%</jacocoCodeCoverage>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>jacoco-prepare-agent</id>
<phase>initialize</phase>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>jacoco-report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>jacoco-check</id>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
<configuration>
<rules>
<rule>
<element>PACKAGE</element>
<limits>
<limit>
<counter>LINE</counter>
<value>COVEREDRATIO</value>
<minimum>${jacocoCodeCoverage}</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<executions>
<execution>
<id>spotless-check-java</id>
<goals>
<goal>check</goal>
</goals>
<configuration>
<java>
<includes>
<include>src/main/java/**/*.java</include>
</includes>
<removeUnusedImports />
<forbidWildcardImports />
<licenseHeader>
<file>${resource.license-header-java}</file>
</licenseHeader>
</java>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>java-library:license</id>
<properties>
<skipTests>true</skipTests>
<license.licenseName>apache_v2</license.licenseName>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
<executions>
<execution>
<id>upsert-license-file</id>
<goals>
<goal>update-project-license</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<executions>
<execution>
<id>update-license-headers-java</id>
<phase>process-sources</phase>
<goals>
<goal>apply</goal>
</goals>
<configuration>
<java>
<includes>
<include>src/main/java/**/*.java</include>
</includes>
<licenseHeader>
<file>${resource.license-header-java}</file>
</licenseHeader>
</java>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>java-library:publish</id>
<properties>
<publishingServerId />
<gpg.keyname />
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>require-publish-properties</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireProperty>
<property>publishingServerId</property>
<regex>.+</regex>
<regexMessage>Property "publishingServerId" is required</regexMessage>
</requireProperty>
<requireProperty>
<property>gpg.keyname</property>
<regex>.+</regex>
<regexMessage>Property "gpg.keyname" is required</regexMessage>
</requireProperty>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<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>
<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>
<executions>
<execution>
<id>sign-artifacts</id>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<bestPractices>true</bestPractices>
<defaultKeyring>false</defaultKeyring>
<keyname>${gpg.keyname}</keyname>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<publishingServerId>${publishingServerId}</publishingServerId>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>