2014-01-20 5 views
3

Jenkins를 사용하여 OSS Sonatype Nexus Server에 아티팩트를 릴리스하려고합니다. 하지만 이슈에 대한 서명을 시도 할 때 다음과 같은 오류가 발생합니다. 내 gpg 키를 생성하고 내 Windows 컴퓨터에서 C :/Users/Sara/AppData/Roaming/gnupg 폴더 아래에 있습니다. 다른 질문 Where to keep a GPG secret key for a Maven project in CI environment?에서 유닉스 기반 환경에 대한 대답을 볼 수 있습니다. 누군가 Windows 환경에서 젠킨스의 비밀 키를 어디에 두어야하는지 알려줄 수 있습니까?Windows에서 실행중인 Jenkins의 GPG 비밀 키를 보관할 위치는 어디입니까?

[INFO] --- maven-gpg-plugin:1.1:sign (sign-artifacts) @ StudentEnrollmentWithREST --- 
    gpg: no default secret key: secret key not available 
    gpg: signing failed: secret key not available 
    [INFO] ------------------------------------------------------------------------ 
    [INFO] BUILD FAILURE 
    [INFO] ------------------------------------------------------------------------ 
    [INFO] Total time: 1:27.647s 
    [INFO] Finished at: Mon Jan 20 12:12:27 CST 2014 
    [INFO] Final Memory: 22M/53M 
    [INFO] ------------------------------------------------------------------------ 
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.1:sign (sign-artifacts) on project StudentEnrollmentWithREST: 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 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 1:45.118s 
[INFO] Finished at: Mon Jan 20 12:12:33 CST 2014 
[INFO] Final Memory: 8M/19M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.1:prepare (default-cli) on project StudentEnrollmentWithREST: Maven execution failed, exit code: '1' -> [Help 1] 
[JENKINS] Archiving C:\Program Files (x86)\Jenkins\workspace\Upload REST Release Artifacts\pom.xml to com.github.elizabetht/StudentEnrollmentWithREST/1.3-SNAPSHOT/StudentEnrollmentWithREST-1.3-SNAPSHOT.pom 
[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 
channel stopped 
Skipping Cobertura coverage report as build was not UNSTABLE or better ... 
Finished: FAILURE 

답변

3

gpg:sign 설명서에 따르면.
기본값이 ~/.gnupg 또는 %APPDATA%/gnupg${gpg.homedir}은 현재 설명하고있는 폴더에서 키링을 찾아야합니다. 기본적으로 pubring.gpgsecring.gpg이라는 파일을 구성 할 수도 있습니다.

아마도 문제는 올바른 키를 찾는 것이고, 그렇지 않은 경우 메이븐은 '기본 키'를 사용합니다. 키링의 첫 번째 키가 기본값입니다.

키를 선택 -이 프로젝트/부모 나 설정에 갈 수도, 또는 커맨드

<properties> 
    <gpg.keyname>C78F3CC4</gpg.keyname> 
</properties> 

일부 다른 구성을하는 것은, '호스트 당'설정에서 어쩌면 프로필 될 가능성이 높습니다. 당신이 OSS Sonatype으로보다는 설정 XML의 명령 줄을 사용하는 경우 XML

<profile> 
    <id>gpg-release</id> 
    <properties> 
     <gpg.passphrase>...</gpg.passphrase> 
     <gpg.useagent>true</gpg.useagent> 
<!-- 
     <gpg.defaultKeyring>false</gpg.defaultKeyring> 
     <gpg.homedir>/private/.../.gnupg</gpg.homedir> 
     <gpg.publicKeyring>/private/.../.gnupg/pubring.gpg</gpg.publicKeyring> 
     <gpg.secretKeyring>/private/.../.gnupg/secring.gpg</gpg.secretKeyring> 
--> 
    </properties> 
</profile> 

은, 그것은 더 체조가 필요합니다.
OSS Sonatype documentation. 받는다는 출시 - 플러그인이 새로운 메이븐 인스턴스를 시작합니다 때문에
-Dgpg.passphrase=PASSPHRASE은 [{인수}와 $의 프로젝트 치어 사용량 구성]

1

를 사용 mvn release:perform -Darguments=-Dgpg.passphrase=PASSPHRASE 한다, 대신,이 경우에는 작동하지 않습니다 아래에 표시된 settings.xml에 다음과 같은 프로필 섹션 추가하기

1

GPG 키를 관리 Jenkins/configure-system에서 저장할 수 있습니다. GPG 키를 추가 할 수있는 RPM 서명 키 섹션이 있습니다. Jenkins에서 필요한 플러그인을 추가하기 전에

관련 문제