Maven 发包问题记录

Maven 发包问题记录

hb0730 127 2024-07-24

Maven 发包记录

PGP 过期问题

gpg: no default secret key: No secret key
gpg: signing failed: No secret key
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  8.551 s
[INFO] Finished at: 2024-07-24T02:56:02Z
[INFO] ------------------------------------------------------------------------
Error:  Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.6:sign (sign-artifacts) on project feishu-robot-core: Exit code: 2 -> [Help 1]
Error:  
Error:  To see the full stack trace of the errors, re-run Maven with the -e switch.
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
错误:[帮助 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
  1. gpg生成
    GitHub 生成新 GPG 密钥
  2. gpg上传
  • keys.gnupg.net gpg --keyserver keys.gnupg.net --send-keys [用户ID]
  • keyserver.ubuntu.com gpg --keyserver keyserver.ubuntu.com --send-keys [用户ID]

nexus

Error:  Failed to execute goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.8:deploy (injected-nexus-deploy) on project feishu-robot-core: Remote staging failed: Failed to deploy artifacts: Could not transfer artifact io.github.group-robot:feishu-robot-core:jar:1.0.5 from/to sonatype-nexus-snapshots (https://s01.oss.sonatype.org:443/service/local/staging/deployByRepositoryId/iogithubgroup-robot-1011): authentication failed for https://s01.oss.sonatype.org:443/service/local/staging/deployByRepositoryId/iogithubgroup-robot-1011/io/github/group-robot/feishu-robot-core/1.0.5/feishu-robot-core-1.0.5.jar, status: 401 Content access is protected by token -> [Help 1]
Error:  
Error:  To see the full stack trace of the errors, re-run Maven with the -e switch.
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

401 Unauthorized error Publishing an artifact 上传受限,需要采用token方式进行上传 可以参考 《Generate a Token on OSSRH Sonatype Nexus Repository Manager servers》 进行配置

资料