GITLAB で Maven プロジェクトの CI をセットアップしています。Maven Central に公開する前に、jar に署名する必要があります。( https://gitlab.com/awe-team/ade )
gnuPgp でキー ペアを生成し、公開キーを gitlab プロファイルに追加します。
秘密鍵のコピーを gitlab-ci ワークフォルダーにコピーしますか?
エラー get は、キーが見つからないというものです。
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-gpg-plugin:1.5:sign'
with basic configurator -->
[DEBUG] (f) ascDirectory = /builds/awe-team/ade/target/gpg
[DEBUG] (f) defaultKeyring = true
[DEBUG] (f) interactive = false
[DEBUG] (f) passphrase = *******
[DEBUG] (f) skip = false
[DEBUG] (f) useAgent = true
[DEBUG] (f) project = MavenProject: com.almis.ade:ade:2.0.5 @ /builds/awe- team/ade/pom.xml
[DEBUG] -- end configuration --
[DEBUG] Generating signature for /builds/awe-team/ade/target/ade-2.0.5.pom
gpg: directory '/root/.gnupg' created
gpg: keybox '/root/.gnupg/pubring.kbx' created
gpg: no default secret key: No secret key
gpg: signing failed: No secret key
私の .gitlab-ci.yaml は行に見えます:
image: maven:latest
variables:
MAVEN_CLI_OPTS: "-X -s .m2/settings.xml --batch-mode -
Dgpg.passphrase=$GPG_PASSPHRASE"
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
cache:
paths:
- .m2/repository/
- target/
build:
stage: build
script:
- mvn $MAVEN_CLI_OPTS compile
test:
stage: test
script:
- mvn $MAVEN_CLI_OPTS test
deploy:
stage: deploy
script:
- mvn $MAVEN_CLI_OPTS deploy
only:
- master
jar のリリースを作成し、それに署名して maven central を公開することを期待していました。