javamavenpom.xmlgnupgmaven-central

How to deploy on Maven Central?


I'm trying to deploy my project into maven central.

I have installed GnuPg via homebrew:

brew install gnupg

so when executing

gpg --version   

the following is returned:

gpg (GnuPG) 2.4.3
libgcrypt 1.10.2
Copyright (C) 2023 g10 Code GmbH

I have created a New Project ticket into Jira - Sonatype

I have followed the instruction related to maven: https://central.sonatype.org/publish/publish-maven/

pom.xml

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

    <developers>
        <developer>
            <name>Paul Marcelin Bejan</name>
            <email>paulmarcelinbejan.developer@gmail.com</email>
            <organization>Paul Marcelin Bejan</organization>
            <organizationUrl>https://github.com/paulmarcelinbejan</organizationUrl>
        </developer>
    </developers>

    <name>ValidaThor</name>
    <description>Validation executed by Thor using his Mjölnir in the battle against bugs to protect the developer.</description>
    <url>https://github.com/paulmarcelinbejan/ValidaThor</url>

    <groupId>io.github.paulmarcelinbejan.toolbox</groupId>
    <artifactId>validathor</artifactId>
    <version>3.0.0</version>
    <packaging>pom</packaging>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>http://www.opensource.org/licenses/mit-license.php</url>
        </license>
    </licenses>

    <properties>
        <!-- JAVA -->
        <java.version>17</java.version>
        <!-- LOMBOK -->
        <lombok.version>1.18.28</lombok.version>
        <!-- MAVEN -->
        <maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
        <!-- JUnit -->
        <junit.version>5.10.0</junit.version>
    </properties>

    <modules>
        <module>validathor-base</module>
        <module>validathor-bfs</module>
        <module>validathor-dfs</module>
    </modules>

    <scm>
        <connection>scm:git:git://github.com/paulmarcelinbejan/ValidaThor.git</connection>
        <developerConnection>scm:git:ssh://github.com:paulmarcelinbejan/ValidaThor.git</developerConnection>
        <url>https://github.com/paulmarcelinbejan/ValidaThor</url>
    </scm>

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

    <dependencyManagement>
        <dependencies>
        
            <!-- Lombok -->
            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>${lombok.version}</version>
                <scope>provided</scope>
            </dependency>
            
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-api</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>

            <!-- Validathor -->
            <dependency>
                <groupId>io.github.paulmarcelinbejan.toolbox</groupId>
                <artifactId>validathor-base</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.github.paulmarcelinbejan.toolbox</groupId>
                <artifactId>validathor-bfs</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.github.paulmarcelinbejan.toolbox</groupId>
                <artifactId>validathor-dfs</artifactId>
                <version>${project.version}</version>
            </dependency>
            
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                    <configuration>
                        <source>${java.version}</source> <!-- depending on your project -->
                        <target>${java.version}</target> <!-- depending on your project -->
                        <annotationProcessorPaths>
                            <path>
                                <groupId>org.projectlombok</groupId>
                                <artifactId>lombok</artifactId>
                                <version>${lombok.version}</version>
                            </path>
                        </annotationProcessorPaths>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>2.2.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>
                    <version>2.9.1</version>
                    <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>1.5</version>
                    <executions>
                        <execution>
                          <id>sign-artifacts</id>
                          <phase>verify</phase>
                          <goals>
                              <goal>sign</goal>
                          </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>1.6.7</version>
                    <extensions>true</extensions>
                    <configuration>
                        <serverId>ossrh</serverId>
                        <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                        <autoReleaseAfterClose>true</autoReleaseAfterClose>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

settings.xml

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
  <servers>
    <server>
      <id>ossrh</id>
      <username>paulmarcelinbejan</username>
      <password>MyRealSecretPasswordIsHere</password>
    </server>
  </servers>
  <profiles>
    <profile>
      <id>ossrh</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <properties>
        <gpg.executable>gpg2</gpg.executable>
        <gpg.passphrase>MyRealSecretPassphraseIsHere</gpg.passphrase>
      </properties>
    </profile>
  </profiles>
  <localRepository>${user.home}/Develop/Personal/maven/repository</localRepository>
  <interactiveMode>true</interactiveMode>
  <offline>false</offline>
</settings>

when executing

mvn clean deploy

I see that the jar is uploaded to ossrh:

[INFO] --- jar:3.3.0:jar (default-jar) @ validathor-dfs ---
[INFO] Building jar: /Users/paulmarcelinbejan/Develop/Personal/projects/ValidaThor/validathor-dfs/target/validathor-dfs-3.0.0.jar
[INFO]
[INFO] --- install:3.1.1:install (default-install) @ validathor-dfs ---
[INFO] Installing /Users/paulmarcelinbejan/Develop/Personal/projects/ValidaThor/validathor-dfs/pom.xml to /Users/paulmarcelinbejan/Develop/Personal/maven/repository/io/github/paulmarcelinbejan/toolbox/validathor-dfs/3.0.0/validathor-dfs-3.0.0.pom
[INFO] Installing /Users/paulmarcelinbejan/Develop/Personal/projects/ValidaThor/validathor-dfs/target/validathor-dfs-3.0.0.jar to /Users/paulmarcelinbejan/Develop/Personal/maven/repository/io/github/paulmarcelinbejan/toolbox/validathor-dfs/3.0.0/validathor-dfs-3.0.0.jar
[INFO]
[INFO] --- deploy:3.1.1:deploy (default-deploy) @ validathor-dfs ---
Uploading to ossrh: https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/io/github/paulmarcelinbejan/toolbox/validathor-dfs/3.0.0/validathor-dfs-3.0.0.pom
Uploaded to ossrh: https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/io/github/paulmarcelinbejan/toolbox/validathor-dfs/3.0.0/validathor-dfs-3.0.0.pom (1.1 kB at 1.5 kB/s)
Uploading to ossrh: https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/io/github/paulmarcelinbejan/toolbox/validathor-dfs/3.0.0/validathor-dfs-3.0.0.jar
Uploaded to ossrh: https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/io/github/paulmarcelinbejan/toolbox/validathor-dfs/3.0.0/validathor-dfs-3.0.0.jar (8.4 kB at 11 kB/s)
Downloading from ossrh: https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/io/github/paulmarcelinbejan/toolbox/validathor-dfs/maven-metadata.xml
Downloaded from ossrh: https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/io/github/paulmarcelinbejan/toolbox/validathor-dfs/maven-metadata.xml (329 B at 2.3 kB/s)
Uploading to ossrh: https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/io/github/paulmarcelinbejan/toolbox/validathor-dfs/maven-metadata.xml
Uploaded to ossrh: https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/io/github/paulmarcelinbejan/toolbox/validathor-dfs/maven-metadata.xml (329 B at 423 B/s)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for ValidaThor 3.0.0:
[INFO]
[INFO] ValidaThor ......................................... SUCCESS [  3.862 s]
[INFO] Validathor Base .................................... SUCCESS [  6.347 s]
[INFO] Validathor BFS ..................................... SUCCESS [  3.495 s]
[INFO] Validathor DFS ..................................... SUCCESS [  3.429 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  17.192 s
[INFO] Finished at: 2023-10-28T20:12:05+02:00
[INFO] ------------------------------------------------------------------------

But I am not able to find it into: https://repo1.maven.org/maven2/io/github/

Then I realize that by mistake I have added the plugins to build.pluginManagement.plugins instead of build.plugins, so I changed the pom.xml:

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

    <developers>
        <developer>
            <name>Paul Marcelin Bejan</name>
            <email>paulmarcelinbejan.developer@gmail.com</email>
            <organization>Paul Marcelin Bejan</organization>
            <organizationUrl>https://github.com/paulmarcelinbejan</organizationUrl>
        </developer>
    </developers>

    <name>ValidaThor</name>
    <description>Validation executed by Thor using his Mjölnir in the battle against bugs to protect the developer.</description>
    <url>https://github.com/paulmarcelinbejan/ValidaThor</url>

    <groupId>io.github.paulmarcelinbejan.toolbox</groupId>
    <artifactId>validathor</artifactId>
    <version>3.0.0</version>
    <packaging>pom</packaging>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>http://www.opensource.org/licenses/mit-license.php</url>
        </license>
    </licenses>

    <properties>
        <!-- JAVA -->
        <java.version>17</java.version>
        <!-- LOMBOK -->
        <lombok.version>1.18.28</lombok.version>
        <!-- MAVEN -->
        <maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
        <!-- JUnit -->
        <junit.version>5.10.0</junit.version>
    </properties>

    <modules>
        <module>validathor-base</module>
        <module>validathor-bfs</module>
        <module>validathor-dfs</module>
    </modules>

    <scm>
        <connection>scm:git:git://github.com/paulmarcelinbejan/ValidaThor.git</connection>
        <developerConnection>scm:git:ssh://github.com:paulmarcelinbejan/ValidaThor.git</developerConnection>
        <url>https://github.com/paulmarcelinbejan/ValidaThor</url>
    </scm>

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

    <dependencyManagement>
        <dependencies>
        
            <!-- Lombok -->
            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>${lombok.version}</version>
                <scope>provided</scope>
            </dependency>
            
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-api</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>

            <!-- Validathor -->
            <dependency>
                <groupId>io.github.paulmarcelinbejan.toolbox</groupId>
                <artifactId>validathor-base</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.github.paulmarcelinbejan.toolbox</groupId>
                <artifactId>validathor-bfs</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.github.paulmarcelinbejan.toolbox</groupId>
                <artifactId>validathor-dfs</artifactId>
                <version>${project.version}</version>
            </dependency>
            
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                    <configuration>
                        <source>${java.version}</source> <!-- depending on your project -->
                        <target>${java.version}</target> <!-- depending on your project -->
                        <annotationProcessorPaths>
                            <path>
                                <groupId>org.projectlombok</groupId>
                                <artifactId>lombok</artifactId>
                                <version>${lombok.version}</version>
                            </path>
                        </annotationProcessorPaths>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.2.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>
                <version>2.9.1</version>
                <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>1.5</version>
                <executions>
                    <execution>
                      <id>sign-artifacts</id>
                      <phase>verify</phase>
                      <goals>
                          <goal>sign</goal>
                      </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.7</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

But now, executing:

mvn -e clean deploy

I have got the following error:

[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] Inspecting build with total of 4 modules...
[INFO] Installing Nexus Staging features:
[INFO]   ... total of 4 executions of maven-deploy-plugin replaced with nexus-staging-maven-plugin
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] ValidaThor                                                         [pom]
[INFO] Validathor Base                                                    [jar]
[INFO] Validathor BFS                                                     [jar]
[INFO] Validathor DFS                                                     [jar]
[INFO]
[INFO] -----------< io.github.paulmarcelinbejan.toolbox:validathor >-----------
[INFO] Building ValidaThor 3.0.0                                          [1/4]
[INFO]   from pom.xml
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- clean:3.2.0:clean (default-clean) @ validathor ---
[INFO] Deleting /Users/paulmarcelinbejan/Develop/Personal/projects/ValidaThor/target
[INFO]
[INFO] --- source:2.2.1:jar-no-fork (attach-sources) @ validathor ---
[INFO]
[INFO] --- javadoc:2.9.1:jar (attach-javadocs) @ validathor ---
[INFO] Not executing Javadoc as the project is not a Java classpath-capable package
[INFO]
[INFO] --- gpg:1.5:sign (sign-artifacts) @ validathor ---
/bin/sh: gpg2: command not found
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for ValidaThor 3.0.0:
[INFO]
[INFO] ValidaThor ......................................... FAILURE [  0.332 s]
[INFO] Validathor Base .................................... SKIPPED
[INFO] Validathor BFS ..................................... SKIPPED
[INFO] Validathor DFS ..................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.615 s
[INFO] Finished at: 2023-10-29T11:34:42+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.5:sign (sign-artifacts) on project validathor: Exit code: 127 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.5:sign (sign-artifacts) on project validathor: Exit code: 127
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:333)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
Caused by: org.apache.maven.plugin.MojoExecutionException: Exit code: 127
    at org.apache.maven.plugin.gpg.GpgSigner.generateSignatureForFile (GpgSigner.java:168)
    at org.apache.maven.plugin.gpg.AbstractGpgSigner.generateSignatureForArtifact (AbstractGpgSigner.java:205)
    at org.apache.maven.plugin.gpg.GpgSignAttachedMojo.execute (GpgSignAttachedMojo.java:176)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Solution

  • I have updated the plugins version as suggested by @khmarbaise

    pom.xml

    <?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>
    
        <developers>
            <developer>
                <name>Paul Marcelin Bejan</name>
                <email>paulmarcelinbejan.developer@gmail.com</email>
                <organization>Paul Marcelin Bejan</organization>
                <organizationUrl>https://github.com/paulmarcelinbejan</organizationUrl>
            </developer>
        </developers>
    
        <name>ValidaThor</name>
        <description>Validation executed by Thor using his Mjölnir in the battle against bugs to protect the developer.</description>
        <url>https://github.com/paulmarcelinbejan/ValidaThor</url>
    
        <groupId>io.github.paulmarcelinbejan.toolbox</groupId>
        <artifactId>validathor</artifactId>
        <version>3.0.0</version>
        <packaging>pom</packaging>
    
        <licenses>
            <license>
                <name>MIT License</name>
                <url>http://www.opensource.org/licenses/mit-license.php</url>
            </license>
        </licenses>
    
        <properties>
            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
            <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
            <!-- JAVA -->
            <java.version>17</java.version>
            <!-- LOMBOK -->
            <lombok.version>1.18.28</lombok.version>
            <!-- MAVEN -->
            <maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
            <maven-source-plugin.version>3.3.0</maven-source-plugin.version>
            <maven-javadoc-plugin.version>3.6.0</maven-javadoc-plugin.version>
            <maven-gpg-plugin.version>3.1.0</maven-gpg-plugin.version>
            <nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
            <!-- JUnit -->
            <junit.version>5.10.0</junit.version>
        </properties>
    
        <modules>
            <module>validathor-base</module>
            <module>validathor-bfs</module>
            <module>validathor-dfs</module>
        </modules>
    
        <scm>
            <connection>scm:git:git://github.com/paulmarcelinbejan/ValidaThor.git</connection>
            <developerConnection>scm:git:ssh://github.com:paulmarcelinbejan/ValidaThor.git</developerConnection>
            <url>https://github.com/paulmarcelinbejan/ValidaThor</url>
        </scm>
    
        <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>
    
        <dependencyManagement>
            <dependencies>
            
                <!-- Lombok -->
                <dependency>
                    <groupId>org.projectlombok</groupId>
                    <artifactId>lombok</artifactId>
                    <version>${lombok.version}</version>
                    <scope>provided</scope>
                </dependency>
                
                <dependency>
                    <groupId>org.junit.jupiter</groupId>
                    <artifactId>junit-jupiter-api</artifactId>
                    <version>${junit.version}</version>
                    <scope>test</scope>
                </dependency>
    
                <!-- Validathor -->
                <dependency>
                    <groupId>io.github.paulmarcelinbejan.toolbox</groupId>
                    <artifactId>validathor-base</artifactId>
                    <version>${project.version}</version>
                </dependency>
                <dependency>
                    <groupId>io.github.paulmarcelinbejan.toolbox</groupId>
                    <artifactId>validathor-bfs</artifactId>
                    <version>${project.version}</version>
                </dependency>
                <dependency>
                    <groupId>io.github.paulmarcelinbejan.toolbox</groupId>
                    <artifactId>validathor-dfs</artifactId>
                    <version>${project.version}</version>
                </dependency>
                
            </dependencies>
        </dependencyManagement>
    
        <dependencies>
            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
            </dependency>
        </dependencies>
    
        <build>
            <pluginManagement>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <version>${maven-compiler-plugin.version}</version>
                        <configuration>
                            <source>${java.version}</source> <!-- depending on your project -->
                            <target>${java.version}</target> <!-- depending on your project -->
                            <encoding>${project.build.sourceEncoding}</encoding>
                            <annotationProcessorPaths>
                                <path>
                                    <groupId>org.projectlombok</groupId>
                                    <artifactId>lombok</artifactId>
                                    <version>${lombok.version}</version>
                                </path>
                            </annotationProcessorPaths>
                        </configuration>
                    </plugin>
                </plugins>
            </pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                </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-no-fork</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>
                </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>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>${nexus-staging-maven-plugin.version}</version>
                    <extensions>true</extensions>
                    <configuration>
                        <serverId>ossrh</serverId>
                        <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                        <autoReleaseAfterClose>true</autoReleaseAfterClose>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    
    </project>
    

    On settings.xml I have changed the gpg.executable to gpg
    settings.xml

    <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
      <servers>
        <server>
          <id>ossrh</id>
          <username>paulmarcelinbejan</username>
          <password>MyRealSecretPasswordIsHere</password>
        </server>
      </servers>
      <profiles>
        <profile>
          <id>ossrh</id>
          <activation>
            <activeByDefault>true</activeByDefault>
          </activation>
          <properties>
            <gpg.executable>gpg</gpg.executable><!-- or gpg2 based on what you have installed -->
            <gpg.passphrase>MyRealSecretPassphraseIsHere</gpg.passphrase>
          </properties>
        </profile>
      </profiles>
      <localRepository>${user.home}/Develop/Personal/maven/repository</localRepository>
      <interactiveMode>true</interactiveMode>
      <offline>false</offline>
    </settings>
    

    Follow The Central Repository Documentation but use the upgraded version of plugins

    1. Getting started https://central.sonatype.org/publish/publish-guide/

    2. Requirements https://central.sonatype.org/publish/requirements/

    3. Coordinates https://central.sonatype.org/publish/requirements/coordinates/

    4. GPG https://central.sonatype.org/publish/requirements/gpg/

    after that for maven project follow:

    1. Publish Maven https://central.sonatype.org/publish/publish-maven/

    after the mvn clean deploy follow:

    1. Release https://central.sonatype.org/publish/release/