Maven版本因发布和gpg插件而被绞死

时间:2013-07-05 14:44:22

标签: maven maven-release-plugin gnupg

我一直在努力使用Maven 3.0.5版本,试图在Windows XP系统中使用maven release插件和maven gpg插件部署到Sonatype repo。我的问题与此SO question完全相同,但那里提供的解决方案都没有为我工作。

我的pom.xml的相关片段是:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-release-plugin</artifactId>
    <version>2.4.1</version>
    <configuration>
        <arguments>-Dgpg.passphrase=${gpg.passphrase}</arguments>
        <!-- see http://jira.codehaus.org/browse/MGPG-9 -->
        <mavenExecutorId>forked-path</mavenExecutorId>
    </configuration>
</plugin>


<profiles>
   <profile>
        <id>release-sign-artifacts</id>
        <activation>
            <property>
                <name>performRelease</name>
                <value>true</value>
            </property>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <configuration>
                        <passphrase>${gpg.passphrase}</passphrase>
                    </configuration>
                    <executions>
                        <execution>
                            <id>sign-artifacts</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>
</profiles>  

<scm>
    <connection>scm:git:https://github.com/pentasoft/s3-static-uploader.git</connection>
    <developerConnection>scm:git:https://github.com/pentasoft/s3-static-uploader.git</developerConnection>
    <url>https://github.com/pentasoft/s3-static-uploader</url>
    <tag>s3-static-uploader-1.0</tag>
</scm>

我的构建的ouptut如下:

---
[INFO] BUILD SUCCESS
[INFO] ---------------------------------------------------------------------
---
[INFO] Total time: 29.737s
[INFO] Finished at: Fri Jul 05 15:58:20 CEST 2013
[INFO] Final Memory: 16M/40M
[INFO] ---------------------------------------------------------------------
---
[INFO] Checking in modified POMs...
[INFO] Executing: cmd.exe /X /C "git add -- pom.xml s3-static-uploader-plugin\po
m.xml s3-static-uploader-example1\pom.xml"
[INFO] Working directory: c:\Inetpub\wwwroot\Pentasoft.git\s3-static-uploader
[INFO] Executing: cmd.exe /X /C "git status"
[INFO] Working directory: c:\Inetpub\wwwroot\Pentasoft.git\s3-static-uploader
[INFO] Executing: cmd.exe /X /C "git commit --verbose -F C:\DOCUME~1\jgg\CONFIG~
1\Temp\maven-scm-870876840.commit pom.xml s3-static-uploader-plugin\pom.xml s3-s
tatic-uploader-example1\pom.xml"
[INFO] Working directory: c:\Inetpub\wwwroot\Pentasoft.git\s3-static-uploader
[INFO] Executing: cmd.exe /X /C "git symbolic-ref HEAD"
[INFO] Working directory: c:\Inetpub\wwwroot\Pentasoft.git\s3-static-uploader
[INFO] Executing: cmd.exe /X /C "git push https://github.com/pentasoft/s3-static
-uploader.git master:master"
[INFO] Working directory: c:\Inetpub\wwwroot\Pentasoft.git\s3-static-uploader

构建在这里挂起。

我已经尝试了之前引用的SO问题中提供的所有解决方案,所有这些解决方案都会产生相同的结果。

1 个答案:

答案 0 :(得分:2)

经过长时间的斗争,主要有两个问题。第一个与pom.xml文件的scm部分中指定的url相关。我的模式是https,github正在提示我输入用户,但是屏幕上没有输出显示该提示。所以第一步是将url架构更改为以下内容:

<scm>
    <connection>scm:git:git@github.com:pentasoft/s3-static-uploader.git</connection>
    <developerConnection>scm:git:git@github.com:pentasoft/s3-static-uploader.git</developerConnection>
    <url>https://github.com/pentasoft/s3-static-uploader</url>
</scm>

其中https架构已被ssh架构替换。

修复此问题后,第二个问题是关于对Github的ssh访问。在启动构建时,Github回答了以下内容:

The authenticity of host 'github.com (207.97.227.239)' can't be established. 
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48. 
Are you sure you want to continue connecting (yes/no)?

与上一个问题一样,这些提示没有显示,感觉是构建再次被挂起。为了解决这个问题,我发出了命令 ssh -T git@github.com (请参阅此Github guide),我对该问题的回答是肯定的,以避免出现该问题。将来

在所有这些之后,构建不再被挂起(遵循之前引用的SO question中@AWhitford的指示。)

使用非Windows框可能会更容易......