s4u / sign-maven-plugin

Maven plugin which creates Open PGP / GPG signatures for all of the project's artifacts
https://www.simplify4u.org/sign-maven-plugin/
Apache License 2.0
47 stars 7 forks source link

Environment variables and POM configuration don't work #81

Closed ddidier closed 3 years ago

ddidier commented 3 years ago

Describe the bug

The documentation states that there is 3 ways to pass the required parameters:

  1. POM configuration
  2. Command line arguments
  3. Environment variables

But only the command line arguments is working.

As this is a really big issue, maybe I did something wrong.

To Reproduce

I followed the tutorial https://www.simplify4u.org/sign-maven-plugin/key-prepare.html to create and export a key.

  1. using POM configuration :
% cat 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 https://maven.apache.org/xsd/maven-4.0.0.xsd">

  <modelVersion>4.0.0</modelVersion>

  ...

  <build>

      <plugins>
        <plugin>
          <groupId>org.simplify4u.plugins</groupId>
          <artifactId>sign-maven-plugin</artifactId>
          <version>0.3.1</version>
          <executions>
            <execution>
              <goals>
                <goal>sign</goal>
              </goals>
              <configuration>
                <keyId>9D08D506AB01D82A8E7090F0C0FF87F9EEC1EF5D</keyId>
                <keyPass>test</keyPass>
                <keyFile>~/.m2/sign-key.ascxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</keyFile>
              </configuration>
            </execution>
          </executions>
        </plugin>
      </plugins>

  </build>

</project>

% mvn sign:sign -X

Apache Maven 3.8.2 (ea98e05a04480131370aa0c110b8c54cf726c06f)
Maven home: /home/someuser/.sdkman/candidates/maven/current
Java version: 16.0.1, vendor: AdoptOpenJDK, runtime: /home/someuser/.sdkman/candidates/java/16.0.1.hs-adpt
Default locale: fr_FR, platform encoding: UTF-8
OS name: "linux", version: "5.11.0-27-generic", arch: "amd64", family: "unix"
[DEBUG] Created new class realm maven.api
[DEBUG] Importing foreign packages into class realm maven.api
[DEBUG]   Imported: javax.annotation.* < plexus.core
[DEBUG]   Imported: javax.annotation.security.* < plexus.core
[DEBUG]   Imported: javax.enterprise.inject.* < plexus.core
[DEBUG]   Imported: javax.enterprise.util.* < plexus.core
[DEBUG]   Imported: javax.inject.* < plexus.core
[DEBUG]   Imported: org.apache.maven.* < plexus.core
[DEBUG]   Imported: org.apache.maven.artifact < plexus.core
[DEBUG]   Imported: org.apache.maven.classrealm < plexus.core
[DEBUG]   Imported: org.apache.maven.cli < plexus.core
[DEBUG]   Imported: org.apache.maven.configuration < plexus.core
[DEBUG]   Imported: org.apache.maven.exception < plexus.core
[DEBUG]   Imported: org.apache.maven.execution < plexus.core
[DEBUG]   Imported: org.apache.maven.execution.scope < plexus.core
[DEBUG]   Imported: org.apache.maven.lifecycle < plexus.core
[DEBUG]   Imported: org.apache.maven.model < plexus.core
[DEBUG]   Imported: org.apache.maven.monitor < plexus.core
[DEBUG]   Imported: org.apache.maven.plugin < plexus.core
[DEBUG]   Imported: org.apache.maven.profiles < plexus.core
[DEBUG]   Imported: org.apache.maven.project < plexus.core
[DEBUG]   Imported: org.apache.maven.reporting < plexus.core
[DEBUG]   Imported: org.apache.maven.repository < plexus.core
[DEBUG]   Imported: org.apache.maven.rtinfo < plexus.core
[DEBUG]   Imported: org.apache.maven.settings < plexus.core
[DEBUG]   Imported: org.apache.maven.toolchain < plexus.core
[DEBUG]   Imported: org.apache.maven.usability < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.* < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.authentication < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.authorization < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.events < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.observers < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.proxy < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.repository < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.resource < plexus.core
[DEBUG]   Imported: org.codehaus.classworlds < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.* < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.classworlds < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.component < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.configuration < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.container < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.context < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.lifecycle < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.logging < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.personality < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.util.xml.Xpp3Dom < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlPullParser < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlPullParserException < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlSerializer < plexus.core
[DEBUG]   Imported: org.eclipse.aether.* < plexus.core
[DEBUG]   Imported: org.eclipse.aether.artifact < plexus.core
[DEBUG]   Imported: org.eclipse.aether.collection < plexus.core
[DEBUG]   Imported: org.eclipse.aether.deployment < plexus.core
[DEBUG]   Imported: org.eclipse.aether.graph < plexus.core
[DEBUG]   Imported: org.eclipse.aether.impl < plexus.core
[DEBUG]   Imported: org.eclipse.aether.installation < plexus.core
[DEBUG]   Imported: org.eclipse.aether.internal.impl < plexus.core
[DEBUG]   Imported: org.eclipse.aether.metadata < plexus.core
[DEBUG]   Imported: org.eclipse.aether.repository < plexus.core
[DEBUG]   Imported: org.eclipse.aether.resolution < plexus.core
[DEBUG]   Imported: org.eclipse.aether.spi < plexus.core
[DEBUG]   Imported: org.eclipse.aether.transfer < plexus.core
[DEBUG]   Imported: org.eclipse.aether.version < plexus.core
[DEBUG]   Imported: org.fusesource.jansi.* < plexus.core
[DEBUG]   Imported: org.slf4j.* < plexus.core
[DEBUG]   Imported: org.slf4j.event.* < plexus.core
[DEBUG]   Imported: org.slf4j.helpers.* < plexus.core
[DEBUG]   Imported: org.slf4j.spi.* < plexus.core
[DEBUG] Populating class realm maven.api
[INFO] Error stacktraces are turned on.
[DEBUG] Message scheme: color
[DEBUG] Message styles: debug info warning error success failure strong mojo project
[DEBUG] Reading global settings from /home/someuser/.sdkman/candidates/maven/current/conf/settings.xml
[DEBUG] Reading user settings from /home/someuser/.m2/settings.xml
[DEBUG] Reading global toolchains from /home/someuser/.sdkman/candidates/maven/current/conf/toolchains.xml
[DEBUG] Reading user toolchains from /home/someuser/.m2/toolchains.xml
[DEBUG] Using local repository at /home/someuser/.m2/repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for /home/someuser/.m2/repository
[INFO] Scanning for projects...
[DEBUG] Extension realms for project name.didier.david:ndd-maven-parent:pom:0.3.0: (none)
[DEBUG] Looking up lifecycle mappings for packaging pom from ClassRealm[plexus.core, parent: null]
[DEBUG] Resolving plugin prefix sign from [org.apache.maven.plugins, org.codehaus.mojo]
[DEBUG] Resolved plugin prefix sign to org.simplify4u.plugins:sign-maven-plugin from POM name.didier.david:ndd-maven-parent:pom:0.3.0
[DEBUG] === REACTOR BUILD PLAN ================================================
[DEBUG] Project: name.didier.david:ndd-maven-parent:pom:0.3.0
[DEBUG] Tasks:   [sign:sign]
[DEBUG] Style:   Regular
[DEBUG] =======================================================================
[INFO]
[INFO] -----------------< name.didier.david:ndd-maven-parent >-----------------
[INFO] Building ndd-maven-parent 0.3.0
[INFO] --------------------------------[ pom ]---------------------------------
[DEBUG] Resolving plugin prefix sign from [org.apache.maven.plugins, org.codehaus.mojo]
[DEBUG] Resolved plugin prefix sign to org.simplify4u.plugins:sign-maven-plugin from POM name.didier.david:ndd-maven-parent:pom:0.3.0
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] === PROJECT BUILD PLAN ================================================
[DEBUG] Project:       name.didier.david:ndd-maven-parent:0.3.0
[DEBUG] Dependencies (collect): []
[DEBUG] Dependencies (resolve): []
[DEBUG] Repositories (dependencies): [maven.gitlab.thalesdigital (https://gitlab.thalesdigital.io/api/v4/groups/loom/-/packages/maven, default, releases+snapshots), central (https://repo.maven.apache.org/maven2, default, releases)]
[DEBUG] Repositories (plugins)     : [central (https://repo.maven.apache.org/maven2, default, releases)]
[DEBUG] -----------------------------------------------------------------------
[DEBUG] Goal:          org.simplify4u.plugins:sign-maven-plugin:0.3.1:sign (default-cli)
[DEBUG] Style:         Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <keyFile default-value="${user.home}/.m2/sign-key.asc">${sign.keyFile}</keyFile>
  <keyId>${sign.keyId}</keyId>
  <keyPass>${sign.keyPass}</keyPass>
  <skip default-value="false">${sign.skip}</skip>
  <skipNoKey default-value="true">${sign.skipNoKey}</skipNoKey>
</configuration>
[DEBUG] =======================================================================
[INFO]
[INFO] --- sign-maven-plugin:0.3.1:sign (default-cli) @ ndd-maven-parent ---
[DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for repository.jboss.org (http://repository.jboss.org/maven2).
[DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for snapshots.jboss.org (http://snapshots.jboss.org/maven2).
[DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for oss.sonatype.org/jboss-snapshots (http://oss.sonatype.org/content/repositories/jboss-snapshots).
[DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for apache.snapshots (http://repository.apache.org/snapshots).
[DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for codehaus-snapshots (http://nexus.codehaus.org/snapshots/).
[DEBUG] Dependency collection stats {ConflictMarker.analyzeTime=583479, ConflictMarker.markTime=149590, ConflictMarker.nodeCount=88, ConflictIdSorter.graphTime=383584, ConflictIdSorter.topsortTime=344586, ConflictIdSorter.conflictIdCount=42, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=3875513, ConflictResolver.conflictItemCount=86, DefaultDependencyCollector.collectTime=168430460, DefaultDependencyCollector.transformTime=6670117}
[DEBUG] org.simplify4u.plugins:sign-maven-plugin:jar:0.3.1
[DEBUG]    org.apache.maven:maven-core:jar:3.6.0:compile
[DEBUG]       org.apache.maven:maven-model:jar:3.6.0:compile
[DEBUG]       org.apache.maven:maven-settings:jar:3.6.0:compile
[DEBUG]       org.apache.maven:maven-settings-builder:jar:3.6.0:compile
[DEBUG]          org.codehaus.plexus:plexus-interpolation:jar:1.25:compile
[DEBUG]          org.sonatype.plexus:plexus-sec-dispatcher:jar:1.4:compile
[DEBUG]             org.sonatype.plexus:plexus-cipher:jar:1.4:compile
[DEBUG]       org.apache.maven:maven-builder-support:jar:3.6.0:compile
[DEBUG]       org.apache.maven:maven-repository-metadata:jar:3.6.0:compile
[DEBUG]       org.apache.maven:maven-artifact:jar:3.6.0:compile (version managed from default)
[DEBUG]       org.apache.maven:maven-model-builder:jar:3.6.0:compile
[DEBUG]       org.apache.maven:maven-resolver-provider:jar:3.6.0:compile
[DEBUG]       org.apache.maven.resolver:maven-resolver-impl:jar:1.3.1:compile
[DEBUG]       org.apache.maven.resolver:maven-resolver-api:jar:1.3.1:compile
[DEBUG]       org.apache.maven.resolver:maven-resolver-spi:jar:1.3.1:compile
[DEBUG]       org.apache.maven.resolver:maven-resolver-util:jar:1.3.1:compile
[DEBUG]       org.apache.maven.shared:maven-shared-utils:jar:3.2.1:compile
[DEBUG]          commons-io:commons-io:jar:2.5:compile
[DEBUG]       org.eclipse.sisu:org.eclipse.sisu.plexus:jar:0.3.3:compile
[DEBUG]          javax.enterprise:cdi-api:jar:1.0:compile
[DEBUG]             javax.annotation:jsr250-api:jar:1.0:compile
[DEBUG]       org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.3.4:compile (version managed from default)
[DEBUG]       com.google.inject:guice:jar:no_aop:4.2.1:compile
[DEBUG]          aopalliance:aopalliance:jar:1.0:compile
[DEBUG]          com.google.guava:guava:jar:25.1-android:compile
[DEBUG]             com.google.code.findbugs:jsr305:jar:3.0.2:compile
[DEBUG]             org.checkerframework:checker-compat-qual:jar:2.0.0:compile
[DEBUG]             com.google.errorprone:error_prone_annotations:jar:2.1.3:compile
[DEBUG]             com.google.j2objc:j2objc-annotations:jar:1.1:compile
[DEBUG]             org.codehaus.mojo:animal-sniffer-annotations:jar:1.14:compile
[DEBUG]       javax.inject:javax.inject:jar:1:compile
[DEBUG]       org.codehaus.plexus:plexus-utils:jar:3.3.0:compile (version managed from default)
[DEBUG]       org.codehaus.plexus:plexus-classworlds:jar:2.5.2:compile
[DEBUG]       org.codehaus.plexus:plexus-component-annotations:jar:2.1.0:compile (version managed from default)
[DEBUG]       org.apache.commons:commons-lang3:jar:3.8.1:compile
[DEBUG]    org.apache.maven:maven-plugin-api:jar:3.6.0:compile
[DEBUG]    org.bouncycastle:bcpg-jdk15on:jar:1.68:compile
[DEBUG]       org.bouncycastle:bcprov-jdk15on:jar:1.68:compile
[DEBUG]    io.vavr:vavr:jar:0.10.3:compile
[DEBUG]       io.vavr:vavr-match:jar:0.10.3:compile
[DEBUG]    org.slf4j:slf4j-api:jar:1.7.30:compile
[DEBUG] Created new class realm plugin>org.simplify4u.plugins:sign-maven-plugin:0.3.1
[DEBUG] Importing foreign packages into class realm plugin>org.simplify4u.plugins:sign-maven-plugin:0.3.1
[DEBUG]   Imported:  < maven.api
[DEBUG] Populating class realm plugin>org.simplify4u.plugins:sign-maven-plugin:0.3.1
[DEBUG]   Included: org.simplify4u.plugins:sign-maven-plugin:jar:0.3.1
[DEBUG]   Included: org.codehaus.plexus:plexus-interpolation:jar:1.25
[DEBUG]   Included: org.sonatype.plexus:plexus-sec-dispatcher:jar:1.4
[DEBUG]   Included: org.sonatype.plexus:plexus-cipher:jar:1.4
[DEBUG]   Included: org.apache.maven:maven-builder-support:jar:3.6.0
[DEBUG]   Included: org.apache.maven.resolver:maven-resolver-util:jar:1.3.1
[DEBUG]   Included: org.apache.maven.shared:maven-shared-utils:jar:3.2.1
[DEBUG]   Included: commons-io:commons-io:jar:2.5
[DEBUG]   Included: javax.enterprise:cdi-api:jar:1.0
[DEBUG]   Included: org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.3.4
[DEBUG]   Included: com.google.inject:guice:jar:no_aop:4.2.1
[DEBUG]   Included: aopalliance:aopalliance:jar:1.0
[DEBUG]   Included: com.google.guava:guava:jar:25.1-android
[DEBUG]   Included: com.google.code.findbugs:jsr305:jar:3.0.2
[DEBUG]   Included: org.checkerframework:checker-compat-qual:jar:2.0.0
[DEBUG]   Included: com.google.errorprone:error_prone_annotations:jar:2.1.3
[DEBUG]   Included: com.google.j2objc:j2objc-annotations:jar:1.1
[DEBUG]   Included: org.codehaus.mojo:animal-sniffer-annotations:jar:1.14
[DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:3.3.0
[DEBUG]   Included: org.codehaus.plexus:plexus-component-annotations:jar:2.1.0
[DEBUG]   Included: org.apache.commons:commons-lang3:jar:3.8.1
[DEBUG]   Included: org.bouncycastle:bcpg-jdk15on:jar:1.68
[DEBUG]   Included: org.bouncycastle:bcprov-jdk15on:jar:1.68
[DEBUG]   Included: io.vavr:vavr:jar:0.10.3
[DEBUG]   Included: io.vavr:vavr-match:jar:0.10.3
[DEBUG] Configuring mojo org.simplify4u.plugins:sign-maven-plugin:0.3.1:sign from plugin realm ClassRealm[plugin>org.simplify4u.plugins:sign-maven-plugin:0.3.1, parent: jdk.internal.loader.ClassLoaders$AppClassLoader@443b7951]
[DEBUG] Configuring mojo 'org.simplify4u.plugins:sign-maven-plugin:0.3.1:sign' with basic configurator -->
[DEBUG]   (f) keyFile = /home/someuser/.m2/sign-key.asc
[DEBUG]   (f) skip = false
[DEBUG]   (f) skipNoKey = true
[DEBUG] -- end configuration --
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.512 s
[INFO] Finished at: 2021-09-22T18:13:35+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.simplify4u.plugins:sign-maven-plugin:0.3.1:sign (default-cli) on project ndd-maven-parent: Execution default-cli of goal org.simplify4u.plugins:sign-maven-plugin:0.3.1:sign failed: Secret key is encrypted - keyPass is required -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.simplify4u.plugins:sign-maven-plugin:0.3.1:sign (default-cli) on project ndd-maven-parent: Execution default-cli of goal org.simplify4u.plugins:sign-maven-plugin:0.3.1:sign failed: Secret key is encrypted - keyPass is required
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:78)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:567)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.simplify4u.plugins:sign-maven-plugin:0.3.1:sign failed: Secret key is encrypted - keyPass is required
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:148)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:78)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:567)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.simplify4u.plugins.sign.openpgp.PGPSignerException: Secret key is encrypted - keyPass is required
    at org.simplify4u.plugins.sign.openpgp.PGPSigner.loadKey (PGPSigner.java:130)
    at org.simplify4u.plugins.sign.openpgp.PGPSigner.setKeyInfo (PGPSigner.java:80)
    at org.simplify4u.plugins.sign.ArtifactSigner.setKeyInfo (ArtifactSigner.java:102)
    at org.simplify4u.plugins.sign.ArtifactSignerFactory.getSigner (ArtifactSignerFactory.java:57)
    at org.simplify4u.plugins.sign.SignMojo.execute (SignMojo.java:151)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:78)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:567)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[ERROR]
[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/PluginExecutionException
  1. using command line arguments
% mvn sign:sign -X -Dsign.keyFile=~/.m2/sign-key.asc -Dsign.keyId=9D08D506AB01D82A8E7090F0C0FF87F9EEC1EF5D -Dsign.keyPass=test

Apache Maven 3.8.2 (ea98e05a04480131370aa0c110b8c54cf726c06f)
Maven home: /home/someuser/.sdkman/candidates/maven/current
Java version: 16.0.1, vendor: AdoptOpenJDK, runtime: /home/someuser/.sdkman/candidates/java/16.0.1.hs-adpt
Default locale: fr_FR, platform encoding: UTF-8
OS name: "linux", version: "5.11.0-27-generic", arch: "amd64", family: "unix"
[DEBUG] Created new class realm maven.api
[DEBUG] Importing foreign packages into class realm maven.api
[DEBUG]   Imported: javax.annotation.* < plexus.core
[DEBUG]   Imported: javax.annotation.security.* < plexus.core
[DEBUG]   Imported: javax.enterprise.inject.* < plexus.core
[DEBUG]   Imported: javax.enterprise.util.* < plexus.core
[DEBUG]   Imported: javax.inject.* < plexus.core
[DEBUG]   Imported: org.apache.maven.* < plexus.core
[DEBUG]   Imported: org.apache.maven.artifact < plexus.core
[DEBUG]   Imported: org.apache.maven.classrealm < plexus.core
[DEBUG]   Imported: org.apache.maven.cli < plexus.core
[DEBUG]   Imported: org.apache.maven.configuration < plexus.core
[DEBUG]   Imported: org.apache.maven.exception < plexus.core
[DEBUG]   Imported: org.apache.maven.execution < plexus.core
[DEBUG]   Imported: org.apache.maven.execution.scope < plexus.core
[DEBUG]   Imported: org.apache.maven.lifecycle < plexus.core
[DEBUG]   Imported: org.apache.maven.model < plexus.core
[DEBUG]   Imported: org.apache.maven.monitor < plexus.core
[DEBUG]   Imported: org.apache.maven.plugin < plexus.core
[DEBUG]   Imported: org.apache.maven.profiles < plexus.core
[DEBUG]   Imported: org.apache.maven.project < plexus.core
[DEBUG]   Imported: org.apache.maven.reporting < plexus.core
[DEBUG]   Imported: org.apache.maven.repository < plexus.core
[DEBUG]   Imported: org.apache.maven.rtinfo < plexus.core
[DEBUG]   Imported: org.apache.maven.settings < plexus.core
[DEBUG]   Imported: org.apache.maven.toolchain < plexus.core
[DEBUG]   Imported: org.apache.maven.usability < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.* < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.authentication < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.authorization < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.events < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.observers < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.proxy < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.repository < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.resource < plexus.core
[DEBUG]   Imported: org.codehaus.classworlds < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.* < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.classworlds < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.component < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.configuration < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.container < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.context < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.lifecycle < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.logging < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.personality < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.util.xml.Xpp3Dom < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlPullParser < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlPullParserException < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlSerializer < plexus.core
[DEBUG]   Imported: org.eclipse.aether.* < plexus.core
[DEBUG]   Imported: org.eclipse.aether.artifact < plexus.core
[DEBUG]   Imported: org.eclipse.aether.collection < plexus.core
[DEBUG]   Imported: org.eclipse.aether.deployment < plexus.core
[DEBUG]   Imported: org.eclipse.aether.graph < plexus.core
[DEBUG]   Imported: org.eclipse.aether.impl < plexus.core
[DEBUG]   Imported: org.eclipse.aether.installation < plexus.core
[DEBUG]   Imported: org.eclipse.aether.internal.impl < plexus.core
[DEBUG]   Imported: org.eclipse.aether.metadata < plexus.core
[DEBUG]   Imported: org.eclipse.aether.repository < plexus.core
[DEBUG]   Imported: org.eclipse.aether.resolution < plexus.core
[DEBUG]   Imported: org.eclipse.aether.spi < plexus.core
[DEBUG]   Imported: org.eclipse.aether.transfer < plexus.core
[DEBUG]   Imported: org.eclipse.aether.version < plexus.core
[DEBUG]   Imported: org.fusesource.jansi.* < plexus.core
[DEBUG]   Imported: org.slf4j.* < plexus.core
[DEBUG]   Imported: org.slf4j.event.* < plexus.core
[DEBUG]   Imported: org.slf4j.helpers.* < plexus.core
[DEBUG]   Imported: org.slf4j.spi.* < plexus.core
[DEBUG] Populating class realm maven.api
[INFO] Error stacktraces are turned on.
[DEBUG] Message scheme: color
[DEBUG] Message styles: debug info warning error success failure strong mojo project
[DEBUG] Reading global settings from /home/someuser/.sdkman/candidates/maven/current/conf/settings.xml
[DEBUG] Reading user settings from /home/someuser/.m2/settings.xml
[DEBUG] Reading global toolchains from /home/someuser/.sdkman/candidates/maven/current/conf/toolchains.xml
[DEBUG] Reading user toolchains from /home/someuser/.m2/toolchains.xml
[DEBUG] Using local repository at /home/someuser/.m2/repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for /home/someuser/.m2/repository
[INFO] Scanning for projects...
[DEBUG] Extension realms for project name.didier.david:ndd-maven-parent:pom:0.3.0: (none)
[DEBUG] Looking up lifecycle mappings for packaging pom from ClassRealm[plexus.core, parent: null]
[DEBUG] Resolving plugin prefix sign from [org.apache.maven.plugins, org.codehaus.mojo]
[DEBUG] Resolved plugin prefix sign to org.simplify4u.plugins:sign-maven-plugin from POM name.didier.david:ndd-maven-parent:pom:0.3.0
[DEBUG] === REACTOR BUILD PLAN ================================================
[DEBUG] Project: name.didier.david:ndd-maven-parent:pom:0.3.0
[DEBUG] Tasks:   [sign:sign]
[DEBUG] Style:   Regular
[DEBUG] =======================================================================
[INFO]
[INFO] -----------------< name.didier.david:ndd-maven-parent >-----------------
[INFO] Building ndd-maven-parent 0.3.0
[INFO] --------------------------------[ pom ]---------------------------------
[DEBUG] Resolving plugin prefix sign from [org.apache.maven.plugins, org.codehaus.mojo]
[DEBUG] Resolved plugin prefix sign to org.simplify4u.plugins:sign-maven-plugin from POM name.didier.david:ndd-maven-parent:pom:0.3.0
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] === PROJECT BUILD PLAN ================================================
[DEBUG] Project:       name.didier.david:ndd-maven-parent:0.3.0
[DEBUG] Dependencies (collect): []
[DEBUG] Dependencies (resolve): []
[DEBUG] Repositories (dependencies): [maven.gitlab.thalesdigital (https://gitlab.thalesdigital.io/api/v4/groups/loom/-/packages/maven, default, releases+snapshots), central (https://repo.maven.apache.org/maven2, default, releases)]
[DEBUG] Repositories (plugins)     : [central (https://repo.maven.apache.org/maven2, default, releases)]
[DEBUG] -----------------------------------------------------------------------
[DEBUG] Goal:          org.simplify4u.plugins:sign-maven-plugin:0.3.1:sign (default-cli)
[DEBUG] Style:         Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <keyFile default-value="${user.home}/.m2/sign-key.asc">${sign.keyFile}</keyFile>
  <keyId>${sign.keyId}</keyId>
  <keyPass>${sign.keyPass}</keyPass>
  <skip default-value="false">${sign.skip}</skip>
  <skipNoKey default-value="true">${sign.skipNoKey}</skipNoKey>
</configuration>
[DEBUG] =======================================================================
[INFO]
[INFO] --- sign-maven-plugin:0.3.1:sign (default-cli) @ ndd-maven-parent ---
[DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for repository.jboss.org (http://repository.jboss.org/maven2).
[DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for snapshots.jboss.org (http://snapshots.jboss.org/maven2).
[DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for oss.sonatype.org/jboss-snapshots (http://oss.sonatype.org/content/repositories/jboss-snapshots).
[DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for apache.snapshots (http://repository.apache.org/snapshots).
[DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for codehaus-snapshots (http://nexus.codehaus.org/snapshots/).
[DEBUG] Dependency collection stats {ConflictMarker.analyzeTime=424721, ConflictMarker.markTime=126989, ConflictMarker.nodeCount=88, ConflictIdSorter.graphTime=255057, ConflictIdSorter.topsortTime=168119, ConflictIdSorter.conflictIdCount=42, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=3823859, ConflictResolver.conflictItemCount=86, DefaultDependencyCollector.collectTime=158085101, DefaultDependencyCollector.transformTime=5704309}
[DEBUG] org.simplify4u.plugins:sign-maven-plugin:jar:0.3.1
[DEBUG]    org.apache.maven:maven-core:jar:3.6.0:compile
[DEBUG]       org.apache.maven:maven-model:jar:3.6.0:compile
[DEBUG]       org.apache.maven:maven-settings:jar:3.6.0:compile
[DEBUG]       org.apache.maven:maven-settings-builder:jar:3.6.0:compile
[DEBUG]          org.codehaus.plexus:plexus-interpolation:jar:1.25:compile
[DEBUG]          org.sonatype.plexus:plexus-sec-dispatcher:jar:1.4:compile
[DEBUG]             org.sonatype.plexus:plexus-cipher:jar:1.4:compile
[DEBUG]       org.apache.maven:maven-builder-support:jar:3.6.0:compile
[DEBUG]       org.apache.maven:maven-repository-metadata:jar:3.6.0:compile
[DEBUG]       org.apache.maven:maven-artifact:jar:3.6.0:compile (version managed from default)
[DEBUG]       org.apache.maven:maven-model-builder:jar:3.6.0:compile
[DEBUG]       org.apache.maven:maven-resolver-provider:jar:3.6.0:compile
[DEBUG]       org.apache.maven.resolver:maven-resolver-impl:jar:1.3.1:compile
[DEBUG]       org.apache.maven.resolver:maven-resolver-api:jar:1.3.1:compile
[DEBUG]       org.apache.maven.resolver:maven-resolver-spi:jar:1.3.1:compile
[DEBUG]       org.apache.maven.resolver:maven-resolver-util:jar:1.3.1:compile
[DEBUG]       org.apache.maven.shared:maven-shared-utils:jar:3.2.1:compile
[DEBUG]          commons-io:commons-io:jar:2.5:compile
[DEBUG]       org.eclipse.sisu:org.eclipse.sisu.plexus:jar:0.3.3:compile
[DEBUG]          javax.enterprise:cdi-api:jar:1.0:compile
[DEBUG]             javax.annotation:jsr250-api:jar:1.0:compile
[DEBUG]       org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.3.4:compile (version managed from default)
[DEBUG]       com.google.inject:guice:jar:no_aop:4.2.1:compile
[DEBUG]          aopalliance:aopalliance:jar:1.0:compile
[DEBUG]          com.google.guava:guava:jar:25.1-android:compile
[DEBUG]             com.google.code.findbugs:jsr305:jar:3.0.2:compile
[DEBUG]             org.checkerframework:checker-compat-qual:jar:2.0.0:compile
[DEBUG]             com.google.errorprone:error_prone_annotations:jar:2.1.3:compile
[DEBUG]             com.google.j2objc:j2objc-annotations:jar:1.1:compile
[DEBUG]             org.codehaus.mojo:animal-sniffer-annotations:jar:1.14:compile
[DEBUG]       javax.inject:javax.inject:jar:1:compile
[DEBUG]       org.codehaus.plexus:plexus-utils:jar:3.3.0:compile (version managed from default)
[DEBUG]       org.codehaus.plexus:plexus-classworlds:jar:2.5.2:compile
[DEBUG]       org.codehaus.plexus:plexus-component-annotations:jar:2.1.0:compile (version managed from default)
[DEBUG]       org.apache.commons:commons-lang3:jar:3.8.1:compile
[DEBUG]    org.apache.maven:maven-plugin-api:jar:3.6.0:compile
[DEBUG]    org.bouncycastle:bcpg-jdk15on:jar:1.68:compile
[DEBUG]       org.bouncycastle:bcprov-jdk15on:jar:1.68:compile
[DEBUG]    io.vavr:vavr:jar:0.10.3:compile
[DEBUG]       io.vavr:vavr-match:jar:0.10.3:compile
[DEBUG]    org.slf4j:slf4j-api:jar:1.7.30:compile
[DEBUG] Created new class realm plugin>org.simplify4u.plugins:sign-maven-plugin:0.3.1
[DEBUG] Importing foreign packages into class realm plugin>org.simplify4u.plugins:sign-maven-plugin:0.3.1
[DEBUG]   Imported:  < maven.api
[DEBUG] Populating class realm plugin>org.simplify4u.plugins:sign-maven-plugin:0.3.1
[DEBUG]   Included: org.simplify4u.plugins:sign-maven-plugin:jar:0.3.1
[DEBUG]   Included: org.codehaus.plexus:plexus-interpolation:jar:1.25
[DEBUG]   Included: org.sonatype.plexus:plexus-sec-dispatcher:jar:1.4
[DEBUG]   Included: org.sonatype.plexus:plexus-cipher:jar:1.4
[DEBUG]   Included: org.apache.maven:maven-builder-support:jar:3.6.0
[DEBUG]   Included: org.apache.maven.resolver:maven-resolver-util:jar:1.3.1
[DEBUG]   Included: org.apache.maven.shared:maven-shared-utils:jar:3.2.1
[DEBUG]   Included: commons-io:commons-io:jar:2.5
[DEBUG]   Included: javax.enterprise:cdi-api:jar:1.0
[DEBUG]   Included: org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.3.4
[DEBUG]   Included: com.google.inject:guice:jar:no_aop:4.2.1
[DEBUG]   Included: aopalliance:aopalliance:jar:1.0
[DEBUG]   Included: com.google.guava:guava:jar:25.1-android
[DEBUG]   Included: com.google.code.findbugs:jsr305:jar:3.0.2
[DEBUG]   Included: org.checkerframework:checker-compat-qual:jar:2.0.0
[DEBUG]   Included: com.google.errorprone:error_prone_annotations:jar:2.1.3
[DEBUG]   Included: com.google.j2objc:j2objc-annotations:jar:1.1
[DEBUG]   Included: org.codehaus.mojo:animal-sniffer-annotations:jar:1.14
[DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:3.3.0
[DEBUG]   Included: org.codehaus.plexus:plexus-component-annotations:jar:2.1.0
[DEBUG]   Included: org.apache.commons:commons-lang3:jar:3.8.1
[DEBUG]   Included: org.bouncycastle:bcpg-jdk15on:jar:1.68
[DEBUG]   Included: org.bouncycastle:bcprov-jdk15on:jar:1.68
[DEBUG]   Included: io.vavr:vavr:jar:0.10.3
[DEBUG]   Included: io.vavr:vavr-match:jar:0.10.3
[DEBUG] Configuring mojo org.simplify4u.plugins:sign-maven-plugin:0.3.1:sign from plugin realm ClassRealm[plugin>org.simplify4u.plugins:sign-maven-plugin:0.3.1, parent: jdk.internal.loader.ClassLoaders$AppClassLoader@443b7951]
[DEBUG] Configuring mojo 'org.simplify4u.plugins:sign-maven-plugin:0.3.1:sign' with basic configurator -->
[DEBUG]   (f) keyFile = /home/someuser/Projets/Personnel/Java/ndd-maven-parent/~/.m2/sign-key.asc
[DEBUG]   (f) keyId = 9D08D506AB01D82A8E7090F0C0FF87F9EEC1EF5D
[DEBUG]   (f) keyPass = test
[DEBUG]   (f) skip = false
[DEBUG]   (f) skipNoKey = true
[DEBUG] -- end configuration --
[INFO] Sign - key not found - skip execution
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.494 s
[INFO] Finished at: 2021-09-22T18:13:50+02:00
[INFO] ------------------------------------------------------------------------
  1. using environment variables
%  SIGN_KEY=~/.m2/sign-key.asc SIGN_KEY_ID=9D08D506AB01D82A8E7090F0C0FF87F9EEC1EF5D SIGN_KEY_PASS=test mvn sign:sign -X

Apache Maven 3.8.2 (ea98e05a04480131370aa0c110b8c54cf726c06f)
Maven home: /home/someuser/.sdkman/candidates/maven/current
Java version: 16.0.1, vendor: AdoptOpenJDK, runtime: /home/someuser/.sdkman/candidates/java/16.0.1.hs-adpt
Default locale: fr_FR, platform encoding: UTF-8
OS name: "linux", version: "5.11.0-27-generic", arch: "amd64", family: "unix"
[DEBUG] Created new class realm maven.api
[DEBUG] Importing foreign packages into class realm maven.api
[DEBUG]   Imported: javax.annotation.* < plexus.core
[DEBUG]   Imported: javax.annotation.security.* < plexus.core
[DEBUG]   Imported: javax.enterprise.inject.* < plexus.core
[DEBUG]   Imported: javax.enterprise.util.* < plexus.core
[DEBUG]   Imported: javax.inject.* < plexus.core
[DEBUG]   Imported: org.apache.maven.* < plexus.core
[DEBUG]   Imported: org.apache.maven.artifact < plexus.core
[DEBUG]   Imported: org.apache.maven.classrealm < plexus.core
[DEBUG]   Imported: org.apache.maven.cli < plexus.core
[DEBUG]   Imported: org.apache.maven.configuration < plexus.core
[DEBUG]   Imported: org.apache.maven.exception < plexus.core
[DEBUG]   Imported: org.apache.maven.execution < plexus.core
[DEBUG]   Imported: org.apache.maven.execution.scope < plexus.core
[DEBUG]   Imported: org.apache.maven.lifecycle < plexus.core
[DEBUG]   Imported: org.apache.maven.model < plexus.core
[DEBUG]   Imported: org.apache.maven.monitor < plexus.core
[DEBUG]   Imported: org.apache.maven.plugin < plexus.core
[DEBUG]   Imported: org.apache.maven.profiles < plexus.core
[DEBUG]   Imported: org.apache.maven.project < plexus.core
[DEBUG]   Imported: org.apache.maven.reporting < plexus.core
[DEBUG]   Imported: org.apache.maven.repository < plexus.core
[DEBUG]   Imported: org.apache.maven.rtinfo < plexus.core
[DEBUG]   Imported: org.apache.maven.settings < plexus.core
[DEBUG]   Imported: org.apache.maven.toolchain < plexus.core
[DEBUG]   Imported: org.apache.maven.usability < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.* < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.authentication < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.authorization < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.events < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.observers < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.proxy < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.repository < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.resource < plexus.core
[DEBUG]   Imported: org.codehaus.classworlds < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.* < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.classworlds < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.component < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.configuration < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.container < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.context < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.lifecycle < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.logging < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.personality < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.util.xml.Xpp3Dom < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlPullParser < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlPullParserException < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlSerializer < plexus.core
[DEBUG]   Imported: org.eclipse.aether.* < plexus.core
[DEBUG]   Imported: org.eclipse.aether.artifact < plexus.core
[DEBUG]   Imported: org.eclipse.aether.collection < plexus.core
[DEBUG]   Imported: org.eclipse.aether.deployment < plexus.core
[DEBUG]   Imported: org.eclipse.aether.graph < plexus.core
[DEBUG]   Imported: org.eclipse.aether.impl < plexus.core
[DEBUG]   Imported: org.eclipse.aether.installation < plexus.core
[DEBUG]   Imported: org.eclipse.aether.internal.impl < plexus.core
[DEBUG]   Imported: org.eclipse.aether.metadata < plexus.core
[DEBUG]   Imported: org.eclipse.aether.repository < plexus.core
[DEBUG]   Imported: org.eclipse.aether.resolution < plexus.core
[DEBUG]   Imported: org.eclipse.aether.spi < plexus.core
[DEBUG]   Imported: org.eclipse.aether.transfer < plexus.core
[DEBUG]   Imported: org.eclipse.aether.version < plexus.core
[DEBUG]   Imported: org.fusesource.jansi.* < plexus.core
[DEBUG]   Imported: org.slf4j.* < plexus.core
[DEBUG]   Imported: org.slf4j.event.* < plexus.core
[DEBUG]   Imported: org.slf4j.helpers.* < plexus.core
[DEBUG]   Imported: org.slf4j.spi.* < plexus.core
[DEBUG] Populating class realm maven.api
[INFO] Error stacktraces are turned on.
[DEBUG] Message scheme: color
[DEBUG] Message styles: debug info warning error success failure strong mojo project
[DEBUG] Reading global settings from /home/someuser/.sdkman/candidates/maven/current/conf/settings.xml
[DEBUG] Reading user settings from /home/someuser/.m2/settings.xml
[DEBUG] Reading global toolchains from /home/someuser/.sdkman/candidates/maven/current/conf/toolchains.xml
[DEBUG] Reading user toolchains from /home/someuser/.m2/toolchains.xml
[DEBUG] Using local repository at /home/someuser/.m2/repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for /home/someuser/.m2/repository
[INFO] Scanning for projects...
[DEBUG] Extension realms for project name.didier.david:ndd-maven-parent:pom:0.3.0: (none)
[DEBUG] Looking up lifecycle mappings for packaging pom from ClassRealm[plexus.core, parent: null]
[DEBUG] Resolving plugin prefix sign from [org.apache.maven.plugins, org.codehaus.mojo]
[DEBUG] Resolved plugin prefix sign to org.simplify4u.plugins:sign-maven-plugin from POM name.didier.david:ndd-maven-parent:pom:0.3.0
[DEBUG] === REACTOR BUILD PLAN ================================================
[DEBUG] Project: name.didier.david:ndd-maven-parent:pom:0.3.0
[DEBUG] Tasks:   [sign:sign]
[DEBUG] Style:   Regular
[DEBUG] =======================================================================
[INFO]
[INFO] -----------------< name.didier.david:ndd-maven-parent >-----------------
[INFO] Building ndd-maven-parent 0.3.0
[INFO] --------------------------------[ pom ]---------------------------------
[DEBUG] Resolving plugin prefix sign from [org.apache.maven.plugins, org.codehaus.mojo]
[DEBUG] Resolved plugin prefix sign to org.simplify4u.plugins:sign-maven-plugin from POM name.didier.david:ndd-maven-parent:pom:0.3.0
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] === PROJECT BUILD PLAN ================================================
[DEBUG] Project:       name.didier.david:ndd-maven-parent:0.3.0
[DEBUG] Dependencies (collect): []
[DEBUG] Dependencies (resolve): []
[DEBUG] Repositories (dependencies): [maven.gitlab.thalesdigital (https://gitlab.thalesdigital.io/api/v4/groups/loom/-/packages/maven, default, releases+snapshots), central (https://repo.maven.apache.org/maven2, default, releases)]
[DEBUG] Repositories (plugins)     : [central (https://repo.maven.apache.org/maven2, default, releases)]
[DEBUG] -----------------------------------------------------------------------
[DEBUG] Goal:          org.simplify4u.plugins:sign-maven-plugin:0.3.1:sign (default-cli)
[DEBUG] Style:         Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <keyFile default-value="${user.home}/.m2/sign-key.asc">${sign.keyFile}</keyFile>
  <keyId>${sign.keyId}</keyId>
  <keyPass>${sign.keyPass}</keyPass>
  <skip default-value="false">${sign.skip}</skip>
  <skipNoKey default-value="true">${sign.skipNoKey}</skipNoKey>
</configuration>
[DEBUG] =======================================================================
[INFO]
[INFO] --- sign-maven-plugin:0.3.1:sign (default-cli) @ ndd-maven-parent ---
[DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for repository.jboss.org (http://repository.jboss.org/maven2).
[DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for snapshots.jboss.org (http://snapshots.jboss.org/maven2).
[DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for oss.sonatype.org/jboss-snapshots (http://oss.sonatype.org/content/repositories/jboss-snapshots).
[DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for apache.snapshots (http://repository.apache.org/snapshots).
[DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for codehaus-snapshots (http://nexus.codehaus.org/snapshots/).
[DEBUG] Dependency collection stats {ConflictMarker.analyzeTime=477597, ConflictMarker.markTime=135184, ConflictMarker.nodeCount=88, ConflictIdSorter.graphTime=240373, ConflictIdSorter.topsortTime=169962, ConflictIdSorter.conflictIdCount=42, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=3510919, ConflictResolver.conflictItemCount=86, DefaultDependencyCollector.collectTime=159820128, DefaultDependencyCollector.transformTime=5423694}
[DEBUG] org.simplify4u.plugins:sign-maven-plugin:jar:0.3.1
[DEBUG]    org.apache.maven:maven-core:jar:3.6.0:compile
[DEBUG]       org.apache.maven:maven-model:jar:3.6.0:compile
[DEBUG]       org.apache.maven:maven-settings:jar:3.6.0:compile
[DEBUG]       org.apache.maven:maven-settings-builder:jar:3.6.0:compile
[DEBUG]          org.codehaus.plexus:plexus-interpolation:jar:1.25:compile
[DEBUG]          org.sonatype.plexus:plexus-sec-dispatcher:jar:1.4:compile
[DEBUG]             org.sonatype.plexus:plexus-cipher:jar:1.4:compile
[DEBUG]       org.apache.maven:maven-builder-support:jar:3.6.0:compile
[DEBUG]       org.apache.maven:maven-repository-metadata:jar:3.6.0:compile
[DEBUG]       org.apache.maven:maven-artifact:jar:3.6.0:compile (version managed from default)
[DEBUG]       org.apache.maven:maven-model-builder:jar:3.6.0:compile
[DEBUG]       org.apache.maven:maven-resolver-provider:jar:3.6.0:compile
[DEBUG]       org.apache.maven.resolver:maven-resolver-impl:jar:1.3.1:compile
[DEBUG]       org.apache.maven.resolver:maven-resolver-api:jar:1.3.1:compile
[DEBUG]       org.apache.maven.resolver:maven-resolver-spi:jar:1.3.1:compile
[DEBUG]       org.apache.maven.resolver:maven-resolver-util:jar:1.3.1:compile
[DEBUG]       org.apache.maven.shared:maven-shared-utils:jar:3.2.1:compile
[DEBUG]          commons-io:commons-io:jar:2.5:compile
[DEBUG]       org.eclipse.sisu:org.eclipse.sisu.plexus:jar:0.3.3:compile
[DEBUG]          javax.enterprise:cdi-api:jar:1.0:compile
[DEBUG]             javax.annotation:jsr250-api:jar:1.0:compile
[DEBUG]       org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.3.4:compile (version managed from default)
[DEBUG]       com.google.inject:guice:jar:no_aop:4.2.1:compile
[DEBUG]          aopalliance:aopalliance:jar:1.0:compile
[DEBUG]          com.google.guava:guava:jar:25.1-android:compile
[DEBUG]             com.google.code.findbugs:jsr305:jar:3.0.2:compile
[DEBUG]             org.checkerframework:checker-compat-qual:jar:2.0.0:compile
[DEBUG]             com.google.errorprone:error_prone_annotations:jar:2.1.3:compile
[DEBUG]             com.google.j2objc:j2objc-annotations:jar:1.1:compile
[DEBUG]             org.codehaus.mojo:animal-sniffer-annotations:jar:1.14:compile
[DEBUG]       javax.inject:javax.inject:jar:1:compile
[DEBUG]       org.codehaus.plexus:plexus-utils:jar:3.3.0:compile (version managed from default)
[DEBUG]       org.codehaus.plexus:plexus-classworlds:jar:2.5.2:compile
[DEBUG]       org.codehaus.plexus:plexus-component-annotations:jar:2.1.0:compile (version managed from default)
[DEBUG]       org.apache.commons:commons-lang3:jar:3.8.1:compile
[DEBUG]    org.apache.maven:maven-plugin-api:jar:3.6.0:compile
[DEBUG]    org.bouncycastle:bcpg-jdk15on:jar:1.68:compile
[DEBUG]       org.bouncycastle:bcprov-jdk15on:jar:1.68:compile
[DEBUG]    io.vavr:vavr:jar:0.10.3:compile
[DEBUG]       io.vavr:vavr-match:jar:0.10.3:compile
[DEBUG]    org.slf4j:slf4j-api:jar:1.7.30:compile
[DEBUG] Created new class realm plugin>org.simplify4u.plugins:sign-maven-plugin:0.3.1
[DEBUG] Importing foreign packages into class realm plugin>org.simplify4u.plugins:sign-maven-plugin:0.3.1
[DEBUG]   Imported:  < maven.api
[DEBUG] Populating class realm plugin>org.simplify4u.plugins:sign-maven-plugin:0.3.1
[DEBUG]   Included: org.simplify4u.plugins:sign-maven-plugin:jar:0.3.1
[DEBUG]   Included: org.codehaus.plexus:plexus-interpolation:jar:1.25
[DEBUG]   Included: org.sonatype.plexus:plexus-sec-dispatcher:jar:1.4
[DEBUG]   Included: org.sonatype.plexus:plexus-cipher:jar:1.4
[DEBUG]   Included: org.apache.maven:maven-builder-support:jar:3.6.0
[DEBUG]   Included: org.apache.maven.resolver:maven-resolver-util:jar:1.3.1
[DEBUG]   Included: org.apache.maven.shared:maven-shared-utils:jar:3.2.1
[DEBUG]   Included: commons-io:commons-io:jar:2.5
[DEBUG]   Included: javax.enterprise:cdi-api:jar:1.0
[DEBUG]   Included: org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.3.4
[DEBUG]   Included: com.google.inject:guice:jar:no_aop:4.2.1
[DEBUG]   Included: aopalliance:aopalliance:jar:1.0
[DEBUG]   Included: com.google.guava:guava:jar:25.1-android
[DEBUG]   Included: com.google.code.findbugs:jsr305:jar:3.0.2
[DEBUG]   Included: org.checkerframework:checker-compat-qual:jar:2.0.0
[DEBUG]   Included: com.google.errorprone:error_prone_annotations:jar:2.1.3
[DEBUG]   Included: com.google.j2objc:j2objc-annotations:jar:1.1
[DEBUG]   Included: org.codehaus.mojo:animal-sniffer-annotations:jar:1.14
[DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:3.3.0
[DEBUG]   Included: org.codehaus.plexus:plexus-component-annotations:jar:2.1.0
[DEBUG]   Included: org.apache.commons:commons-lang3:jar:3.8.1
[DEBUG]   Included: org.bouncycastle:bcpg-jdk15on:jar:1.68
[DEBUG]   Included: org.bouncycastle:bcprov-jdk15on:jar:1.68
[DEBUG]   Included: io.vavr:vavr:jar:0.10.3
[DEBUG]   Included: io.vavr:vavr-match:jar:0.10.3
[DEBUG] Configuring mojo org.simplify4u.plugins:sign-maven-plugin:0.3.1:sign from plugin realm ClassRealm[plugin>org.simplify4u.plugins:sign-maven-plugin:0.3.1, parent: jdk.internal.loader.ClassLoaders$AppClassLoader@443b7951]
[DEBUG] Configuring mojo 'org.simplify4u.plugins:sign-maven-plugin:0.3.1:sign' with basic configurator -->
[DEBUG]   (f) keyFile = /home/someuser/.m2/sign-key.asc
[DEBUG]   (f) skip = false
[DEBUG]   (f) skipNoKey = true
[DEBUG] -- end configuration --
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.483 s
[INFO] Finished at: 2021-09-22T18:15:11+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.simplify4u.plugins:sign-maven-plugin:0.3.1:sign (default-cli) on project ndd-maven-parent: Execution default-cli of goal org.simplify4u.plugins:sign-maven-plugin:0.3.1:sign failed: Secret key not found -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.simplify4u.plugins:sign-maven-plugin:0.3.1:sign (default-cli) on project ndd-maven-parent: Execution default-cli of goal org.simplify4u.plugins:sign-maven-plugin:0.3.1:sign failed: Secret key not found
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:78)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:567)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.simplify4u.plugins:sign-maven-plugin:0.3.1:sign failed: Secret key not found
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:148)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:78)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:567)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.simplify4u.plugins.sign.openpgp.PGPSignerException: Secret key not found
    at org.simplify4u.plugins.sign.openpgp.PGPSigner.lambda$loadKey$2 (PGPSigner.java:121)
    at java.util.Optional.orElseThrow (Optional.java:403)
    at org.simplify4u.plugins.sign.openpgp.PGPSigner.loadKey (PGPSigner.java:121)
    at org.simplify4u.plugins.sign.openpgp.PGPSigner.setKeyInfo (PGPSigner.java:80)
    at org.simplify4u.plugins.sign.ArtifactSigner.setKeyInfo (ArtifactSigner.java:102)
    at org.simplify4u.plugins.sign.ArtifactSignerFactory.getSigner (ArtifactSignerFactory.java:57)
    at org.simplify4u.plugins.sign.SignMojo.execute (SignMojo.java:151)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:78)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:567)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[ERROR]
[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/PluginExecutionException

Using:

% mvn -v

Apache Maven 3.8.2 (ea98e05a04480131370aa0c110b8c54cf726c06f)
Maven home: /home/someuser/.sdkman/candidates/maven/current
Java version: 16.0.1, vendor: AdoptOpenJDK, runtime: /home/someuser/.sdkman/candidates/java/16.0.1.hs-adpt
Default locale: fr_FR, platform encoding: UTF-8
OS name: "linux", version: "5.11.0-27-generic", arch: "amd64", family: "unix"

Expected behavior

Environment variables and POM configuration should work.

ddidier commented 3 years ago

I didn't see that the key was not found using cli arguments. Even this one is not working when I pass an absolute file path. I must do something wrong but I don't know what.

slawekjaranowski commented 3 years ago

can you try configuration like:

<plugins>
    <plugin>
        <groupId>org.simplify4u.plugins</groupId>
        <artifactId>sign-maven-plugin</artifactId>
        <version>0.3.1</version>
        <executions>
            <execution>
                <goals>
                    <goal>sign</goal>
                </goals>
            </execution>
        </executions>
        <configuration>
            <keyId>9D08D506AB01D82A8E7090F0C0FF87F9EEC1EF5D</keyId>
            <keyPass>test</keyPass>
            <keyFile>~/.m2/sign-key.ascxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</keyFile>
        </configuration>
    </plugin>
</plugins>

run only sign:sing without build package probably cause to not found artifact to sign - but configuration should be accessible by plugin

slawekjaranowski commented 3 years ago

https://maven.apache.org/guides/mini/guide-default-execution-ids.html

ddidier commented 3 years ago

mvn clean install sign:sign is working with:

    <plugin>
        <groupId>org.simplify4u.plugins</groupId>
        <artifactId>sign-maven-plugin</artifactId>
        <version>0.3.1</version>
        <executions>
            <execution>
                <goals>
                    <goal>sign</goal>
                </goals>
            </execution>
        </executions>
        <configuration>
            <keyId>9D08D506AB01D82A8E7090F0C0FF87F9EEC1EF5D</keyId>
            <keyPass>test</keyPass>
            <keyFile>/home/xxx/.m2/sign-key.asc</keyFile>
        </configuration>
    </plugin>

Note that keyFile is /home/xxx/.m2/sign-key.asc and not ~/.m2/sign-key.asc which is not working. That makes sense since this is a Java program.

But SIGN_KEY=/home/xxx/.m2/sign-key.asc SIGN_KEY_ID=9D08D506AB01D82A8E7090F0C0FF87F9EEC1EF5D SIGN_KEY_PASS=test mvn clean install sign:sign is not working with:

    <plugin>
        <groupId>org.simplify4u.plugins</groupId>
        <artifactId>sign-maven-plugin</artifactId>
        <version>0.3.1</version>
        <executions>
            <execution>
                <goals>
                    <goal>sign</goal>
                </goals>
            </execution>
        </executions>
    </plugin>

The environment variables are not taken into account:

[DEBUG] Configuring mojo org.simplify4u.plugins:sign-maven-plugin:0.3.1:sign from plugin realm ClassRealm[plugin>org.simplify4u.plugins:sign-maven-plugin:0.3.1, parent: jdk.internal.loader.ClassLoaders$AppClassLoader@443b7951]
[DEBUG] Configuring mojo 'org.simplify4u.plugins:sign-maven-plugin:0.3.1:sign' with basic configurator -->
[DEBUG]   (f) keyFile = /home/xxx/.m2/sign-key.asc
[DEBUG]   (f) skip = false
[DEBUG]   (f) skipNoKey = true
[DEBUG] -- end configuration --
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.922 s
[INFO] Finished at: 2021-09-24T10:02:14+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.simplify4u.plugins:sign-maven-plugin:0.3.1:sign (default-cli) on project ndd-maven-parent: Execution default-cli of goal org.simplify4u.plugins:sign-maven-plugin:0.3.1:sign failed: Secret key not found -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.simplify4u.plugins:sign-maven-plugin:0.3.1:sign (default-cli) on project ndd-maven-parent: Execution default-cli of goal org.simplify4u.plugins:sign-maven-plugin:0.3.1:sign failed: Secret key not found
...

And mvn clean install sign:sign -Dsign.keyFile=/home/xxx/.m2/sign-key.asc -Dsign.keyId=9D08D506AB01D82A8E7090F0C0FF87F9EEC1EF5D -Dsign.keyPass=test is not working either although the variables seem to be taken into account:

[DEBUG] Configuring mojo org.simplify4u.plugins:sign-maven-plugin:0.3.1:sign from plugin realm ClassRealm[plugin>org.simplify4u.plugins:sign-maven-plugin:0.3.1, parent: jdk.internal.loader.ClassLoaders$AppClassLoader@443b7951]
[DEBUG] Configuring mojo 'org.simplify4u.plugins:sign-maven-plugin:0.3.1:sign' with basic configurator -->
[DEBUG]   (f) keyFile = /home/xxx/.m2/sign-key.asc
[DEBUG]   (f) keyId = 9D08D506AB01D82A8E7090F0C0FF87F9EEC1EF5D
[DEBUG]   (f) keyPass = test
[DEBUG]   (f) skip = false
[DEBUG]   (f) skipNoKey = true
[DEBUG] -- end configuration --
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.900 s
[INFO] Finished at: 2021-09-24T10:06:04+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.simplify4u.plugins:sign-maven-plugin:0.3.1:sign (default-cli) on project ndd-maven-parent: Execution default-cli of goal org.simplify4u.plugins:sign-maven-plugin:0.3.1:sign failed: Secret key not found -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.simplify4u.plugins:sign-maven-plugin:0.3.1:sign (default-cli) on project ndd-maven-parent: Execution default-cli of goal org.simplify4u.plugins:sign-maven-plugin:0.3.1:sign failed: Secret key not found
...
ddidier commented 3 years ago

I created a small test case: sign-tests.tar.gz

slawekjaranowski commented 3 years ago

test2.sh

misunderstand configuration: SIGN_KEY - environment variable must contain private key content. https://www.simplify4u.org/sign-maven-plugin/sign-mojo.html#keyFile

so change test to:

export SIGN_KEY=`cat sign-key.asc`

and will be ok

we can improve documentation in this point - if you like please prepare proposition

test3.sh

configuration tags was moved from execution level to plugin level and change command from

mvn sign:sing 

to

mvn clen install sign:sing 

execution hints

callling

mvn clean install sign:sign

cause to run sign plugin execute twice, once during verify maven phase and one from direct invoke from command line it is enough to run mvn clean instal - sign plugin will bind to proper maven lifecycle phase

ddidier commented 3 years ago

Thanks, that's now working!

The documentation says "Default value is: ${user.home}/.m2/sign-key.asc" so I thought that SIGN_KEY was a file too. So maybe change:

_This value can be delivered by environment variable SIGNKEY. Environment variable must contain private key content.

to something like this:

_This value can be delivered by environment variable SIGN_KEY. Environment variable must contain private key content, not the file path. Example: export SIGN_KEY=$(cat mykey.asc)_

slawekjaranowski commented 3 years ago

I'm happy that is working. If you have another question/problem please create new issue.