gpt4 book ai didi

java - mvn deploy --> maven-gpg-plugin :1. 5 :sign failing. 已经工作了一个星期了。除了新的项目版本号之外,没有对 POM 的更改

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:12:52 25 4
gpt4 key购买 nike

我已经成功使用 mvn deploy 大约一个星期了,但突然间它不起作用了。它曾经提示我输入密码(在对话框窗口中——我在 Windows 7 32 位上使用 Kleopatra),但现在不再是了。 POM 中唯一更改的是项目的版本号。

有两个随机结果,都是坏的:

首先,这个输出,我没有按任何键打印出来:

R:\jeffy\programming\sandbox\z__for_git_commit_only\xbnjava>mvn deploy
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building XBN-Java 0.1.4.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- build-helper-maven-plugin:1.8:attach-artifact (attach-artifacts) @ xbnjava ---
[INFO]
[INFO] --- maven-gpg-plugin:1.5:sign (sign-artifacts) @ xbnjava ---

You need a passphrase to unlock the secret key for
user: "MY NAME HERE <MY_EMAIL_HERE@yahoo.com>"
2048-bit RSA key, ID 4AB64866, created 2014-07-15

OK Your orders please
OK
OK
OK
OK
OK
D 4204
OK
OK
OK

按下回车后,这是响应:

gpg: Invalid passphrase; please try again ...
gpg: Invalid passphrase; please try again ...

You need a passphrase to unlock the secret key for
user: "MY NAME HERE <MY_EMAIL_HERE@yahoo.com>"
2048-bit RSA key, ID 4AB64866, created 2014-07-15

OK Your orders please
OK
OK
OK
OK
OK
D 5220
OK
gpg: AllowSetForegroundWindow(5220) failed: Access is denied.

OK
OK
OK
gpg: AllowSetForegroundWindow(5220) failed: Access is denied.

这里又卡住了,此时我用Ctrl+C取消

Terminate batch job (Y/N)? y

R:\jeffy\programming\sandbox\z__for_git_commit_only\xbnjava>

我看到了 AllowSetForegroundWindow(5220),并找到了 this about it , 但它没有说明具体要做什么。

我又试了一次,得到了这个:

R:\jeffy\programming\sandbox\z__for_git_commit_only\xbnjava>mvn deploy
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building XBN-Java 0.1.4.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- build-helper-maven-plugin:1.8:attach-artifact (attach-artifacts) @ xbnjava ---
[INFO]
[INFO] --- maven-gpg-plugin:1.5:sign (sign-artifacts) @ xbnjava ---

You need a passphrase to unlock the secret key for
user: "MY NAME HERE <MY_EMAIL_HERE@yahoo.com>"
2048-bit RSA key, ID 4AB64866, created 2014-07-15

我在这里输入我的密码并按回车键,但没有任何反应。它卡住了。我取消了这个过程,它以纯文本形式打印了我的密码:

Terminate batch job (Y/N)? MY_PASSPHRASE_PRINTED_HERE
Terminate batch job (Y/N)? y

R:\jeffy\programming\sandbox\z__for_git_commit_only\xbnjava>

我再次尝试,原来的事情又发生了(“...好的,请您下订单,好的,好的,好的,好的,好的...”)。我输入我的密码,然后它开始工作(我不确定它实际使用的时间,现在看来),这意味着 jars 已成功上传,但在日志的末尾,在“构建成功”消息之后......

R:\jeffy\programming\sandbox\z__for_git_commit_only\xbnjava>mvn deploy
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building XBN-Java 0.1.4.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- build-helper-maven-plugin:1.8:attach-artifact (attach-artifacts) @ xbnjava ---
[INFO]
[INFO] --- maven-gpg-plugin:1.5:sign (sign-artifacts) @ xbnjava ---

You need a passphrase to unlock the secret key for
user: "MY NAME HERE <MY_EMAIL_HERE@yahoo.com>"
2048-bit RSA key, ID 4AB64866, created 2014-07-15


You need a passphrase to unlock the secret key for
user: "MY NAME HERE <MY_EMAIL_HERE@yahoo.com>"
2048-bit RSA key, ID 4AB64866, created 2014-07-15


You need a passphrase to unlock the secret key for
user: "MY NAME HERE <MY_EMAIL_HERE@yahoo.com>"
2048-bit RSA key, ID 4AB64866, created 2014-07-15


You need a passphrase to unlock the secret key for
user: "MY NAME HERE <MY_EMAIL_HERE@yahoo.com>"
2048-bit RSA key, ID 4AB64866, created 2014-07-15

[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ xbnjava ---
[INFO] Installing R:\jeffy\programming\sandbox\z__for_git_commit_only\xbnjava\pom.xml to C:\Users\jeffy\.m2\repository\com\github\aliteralmind\xbnjava\0.1.4.1\xbnjava-0.1.4.1.pom
[INFO] Installing R:\jeffy\programming\build\xbnjava-0.1.4.1\download\xbnjava-0.1.4.1.jar to C:\Users\jeffy\.m2\repository\com\github\aliteralmind\xbnjava\0.1.4.1\xbnjava-0.1.4.1.jar
[INFO] Installing R:\jeffy\programming\build\xbnjava-0.1.4.1\download\xbnjava-0.1.4.1-javadoc.jar to C:\Users\jeffy\.m2\repository\com\github\aliteralmind\xbnjava\0.1.4.1\xbnjava-0.1.4.1-javadoc.jar
[INFO] Installing R:\jeffy\programming\build\xbnjava-0.1.4.1\download\xbnjava-0.1.4.1-sources.jar to C:\Users\jeffy\.m2\repository\com\github\aliteralmind\xbnjava\0.1.4.1\xbnjava-0.1.4.1-sources.jar
[INFO] Installing R:\jeffy\programming\sandbox\z__for_git_commit_only\xbnjava\target\xbnjava-0.1.4.1.pom.asc to C:\Users\jeffy\.m2\repository\com\github\aliteralmind\xbnjava\0.1.4.1\xbnjava-0.1.4.1.pom.asc
[INFO] Installing R:\jeffy\programming\sandbox\z__for_git_commit_only\xbnjava\target\gpg\jeffy\programming\build\xbnjava-0.1.4.1\download\xbnjava-0.1.4.1.jar.asc to C:\Users\jeffy\.m2\repository\com\github\aliteralmind\xbnjava\0.1.4.1\xbnjava-0.1.4.1.jar.asc
[INFO] Installing R:\jeffy\programming\sandbox\z__for_git_commit_only\xbnjava\target\gpg\jeffy\programming\build\xbnjava-0.1.4.1\download\xbnjava-0.1.4.1-javadoc.jar.asc to C:\Users\jeffy\.m2\repository\com\github\aliteralmind\xbnjava\0.1.4.1\xbnjava-0.1.4.1-javadoc.jar.asc
[INFO] Installing R:\jeffy\programming\sandbox\z__for_git_commit_only\xbnjava\target\gpg\jeffy\programming\build\xbnjava-0.1.4.1\download\xbnjava-0.1.4.1-sources.jar.asc to C:\Users\jeffy\.m2\repository\com\github\aliteralmind\xbnjava\0.1.4.1\xbnjava-0.1.4.1-sources.jar.asc
[INFO]
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ xbnjava ---
Uploading: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.4.1/xbnjava-0.1.4.1.pom
Uploaded: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.4.1/xbnjava-0.1.4.1.pom (6 KB at 4.2 KB/sec)
Downloading: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/maven-metadata.xml
Downloaded: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/maven-metadata.xml (314 B at 0.9 KB/sec)
Uploading: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/maven-metadata.xml
Uploaded: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/maven-metadata.xml (314 B at 1.4 KB/sec)
Uploading: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.4.1/xbnjava-0.1.4.1.jar
Uploaded: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.4.1/xbnjava-0.1.4.1.jar (630 KB at 439.6 KB/sec)
Uploading: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.4.1/xbnjava-0.1.4.1-javadoc.jar
Uploaded: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.4.1/xbnjava-0.1.4.1-javadoc.jar (5093 KB at 572.4 KB/sec)
Uploading: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.4.1/xbnjava-0.1.4.1-sources.jar
Uploaded: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.4.1/xbnjava-0.1.4.1-sources.jar (10728 KB at 609.9 KB/sec)
Uploading: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.4.1/xbnjava-0.1.4.1.pom.asc
Uploaded: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.4.1/xbnjava-0.1.4.1.pom.asc (499 B at 2.0 KB/sec)
Uploading: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.4.1/xbnjava-0.1.4.1.jar.asc
Uploaded: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.4.1/xbnjava-0.1.4.1.jar.asc (499 B at 1.9 KB/sec)
Uploading: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.4.1/xbnjava-0.1.4.1-javadoc.jar.asc
Uploaded: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.4.1/xbnjava-0.1.4.1-javadoc.jar.asc (499 B at 2.0 KB/sec)
Uploading: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.4.1/xbnjava-0.1.4.1-sources.jar.asc
Uploaded: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.4.1/xbnjava-0.1.4.1-sources.jar.asc (499 B at 2.2 KB/sec)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 37.724 s
[INFO] Finished at: 2014-07-30T13:58:42-04:00
[INFO] Final Memory: 6M/17M
[INFO] ------------------------------------------------------------------------

结尾是这样的:

'import site' failed; use -v for traceback
Traceback (most recent call last):
File "C:\applications\programming\python_341\Lib\cmd.py", line 45, in ?
import string, sys
File "C:\applications\programming\python_341\Lib\string.py", line 73
class Template(metaclass=_TemplateMetaclass):
^
SyntaxError: invalid syntax

请注意,所有这些

You need a passphrase to unlock the secret key for
user: "MY NAME HERE <MY_EMAIL_HERE@yahoo.com>"
2048-bit RSA key, ID 4AB64866, created 2014-07-15

我从不碰键盘。


完整设置.xml:

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>ossrh</id>
<username>MY_SONATYPE_DOT_COM_USERNAME</username>
<password>MY_SONATYPE_DOT_COM_PASSWORD</password>
</server>
</servers>

<pluginGroups></pluginGroups>
<proxies></proxies>
<mirrors></mirrors>
<profiles></profiles>
</settings>

完整的 pom.xml:

<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 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.aliteralmind</groupId>
<artifactId>xbnjava</artifactId>
<packaging>pom</packaging>
<version>0.1.4.1</version>
<name>XBN-Java</name>
<url>https://github.com/aliteralmind/xbnjava</url>
<inceptionYear>2014</inceptionYear>
<organization>
<name>Jeff Epstein</name>
</organization>
<description>XBN-Java is a collection of generically-useful backend (server side, non-GUI) programming utilities, featuring RegexReplacer and FilteredLineIterator. XBN-Java is the foundation of Codelet (http://codelet.aliteralmind.com).</description>

<licenses>
<license>
<name>Lesser General Public License (LGPL) version 3.0</name>
<url>https://www.gnu.org/licenses/lgpl-3.0.txt</url>
</license>
<license>
<name>Apache Software License (ASL) version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>

<developers>
<developer>
<name>Jeff Epstein</name>
<email>aliteralmind-github@yahoo.com</email>
<roles>
<role>Lead Developer</role>
</roles>
</developer>
</developers>

<issueManagement>
<system>GitHub Issue Tracker</system>
<url>https://github.com/aliteralmind/xbnjava/issues</url>
</issueManagement>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>

<scm>
<connection>scm:git:git@github.com:aliteralmind/xbnjava.git</connection>
<url>scm:git:git@github.com:aliteralmind/xbnjava.git</url>
<developerConnection>scm:git:git@github.com:aliteralmind/xbnjava.git</developerConnection>
</scm>

<properties>
<java.version>1.7</java.version>
<jarprefix>R:\jeffy\programming\build\/${project.artifactId}-${project.version}/download/${project.artifactId}-${project.version}</jarprefix>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>${jarprefix}.jar</file>
<type>jar</type>
</artifact>
<artifact>
<file>${jarprefix}-javadoc.jar</file>
<type>jar</type>
<classifier>javadoc</classifier>
</artifact>
<artifact>
<file>${jarprefix}-sources.jar</file>
<type>jar</type>
<classifier>sources</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<!--
<profiles>
This profile will sign the JAR file, sources file, and javadocs file using the GPG key on the local machine.
See: https://docs.sonatype.org/display/Repository/How+To+Generate+PGP+Signatures+With+Maven
<profile>
<id>release-sign-artifacts</id>
<activation>
<property>
<name>release</name>
<value>true</value>
</property>
</activation>
</profile>
</profiles>
-->

<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>4.0</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.3.2</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>16.0</version>
</dependency>
</dependencies>

</project>

最佳答案

像这样在 ~/.m2/settings.xml 中设置你的 gpg.passphrase:

<server>
<id>gpg.passphrase</id>
<passphrase>clear or encrypted text</passphrase>
</server>

或者调用maven时作为参数传递:

mvn -Dgpg.passphrase=yourpassphrase deploy

关于java - mvn deploy --> maven-gpg-plugin :1. 5 :sign failing. 已经工作了一个星期了。除了新的项目版本号之外,没有对 POM 的更改,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25044403/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com