- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我对 Maven 和上传东西到 Sonatype 都是新手,所以错误可能很明显,但它对我隐藏得很好。我正在尝试上传 Artifact 。
为此,我运行以下命令
mvn clean assembly:single -s settings.xml assembly:single javadoc:jar source:jar gpg:sign -Dgpg.passphrase=myPassphrase install deploy
但是,这会导致 Nexus 无法验证 JAR 文件,因为上传中没有包含 asc 签名文件 - 这是事实,但我不明白为什么。此外,还有 .xml 文件和 .zip、.tar.gz 和 .tar.bz2 文件的签名。对于要为 jars 生成的 asc,我应该指定什么?
下面显示了我的 settings.xml 和 pom.xml 文件:
设置.xml:
<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>sonatype</id>
<username>myUsername</username>
<password>myPassword</password>
</server>
</servers>
</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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.aaryn101</groupId>
<artifactId>lol4j</artifactId>
<version>2.0</version>
<packaging>jar</packaging>
<name>lol4j</name>
<description>lol4j is a Java wrapper for the Riot Games LoL beta API.</description>
<url>https://github.com/aaryn101/lol4j</url>
<licenses>
<license>
<name>The MIT License (MIT)</name>
<url>http://opensource.org/licenses/MIT</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>https://github.com/aaryn101/lol4j.git</url>
</scm>
<distributionManagement>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
</repository>
</distributionManagement>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<configuration>
<descriptor>dep.xml</descriptor>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
最佳答案
为了将 jars 上传到 maven 存储库,您需要使用公钥对它们进行签名,该公钥必须在给定的 key 服务器上可用。在这里查看 detailed instructions ,还有这个 blog post也很有帮助。
最重要的步骤是创建 key 并将其上传到 key 服务器(上面的链接中有详细说明)。
然后编辑 settings.xml 使 PGP key 对 Maven 可用:
<profiles>
<profile>
<id>gpg</id>
<properties>
<gpg.passphrase>your passphrase</gpg.passphrase>
<gpg.keyname>your pgp key</gpg.keyname>
</properties>
</profile>
</profiles>
然后将其添加到 pom.xml 中以便对 jars 进行签名:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
这是一个 working pom.xml 的例子.
关于java - Maven - 生成 JARs GPG 签名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22947168/
(kubuntu,但在我的方法中试图保持平台独立。) 概念解释或必要步骤都值得赞赏。 我正在阅读文档,并试图获取 gpg-agent工作一次,但我感到气馁,因为每次尝试都需要重新启动,而且我并不真正理
记录遇到的问题; 在aliyun上安装MySQL时由于上次错误卸载mysql 导致校验文件出问题; 处理方式有几种 1到mysql官网下载校验文件 2跳过校验,记录第二种 编
我想为一个 atm 创建一个自动 GnuPG key 生成脚本,尽管他们运行 ubuntu,但不习惯使用 CLI。此外,其他人管理他们的计算机,使其保持最新状态并处于良好的运行状态,因此他们也没有 r
我刚刚不小心丢失了旧的 gpg key 。我想知道我是否可以删除每个提交的 gpg 标志或使用我的新 gpg key 重新签名? 最佳答案 我知道这是一个老问题,但我遇到了类似的情况,我不得不签署(实
作为 perl 脚本的一部分,我根据从电子邮件中获得的周期数从网站下载一些文件。我使用正则表达式找到合适的周期数,将其附加到 url 并从所述 url 获取加密文件。然后我将加密文件打印到临时文件,并
查看Subj:如何在不使用本地存储(在〜/.gpg下)的情况下从gpg中的私有(private)获取公钥? 此解决方案不满足要求: $ gpg --import priv.key $ gpg --ex
我有 1 个 github 用户和另一个 gitlab 用户,我为每个用户创建了 1 个 gpg key ,因为我的电子邮件地址不同。 问题是我必须执行 git config --global use
我在运行这段代码时遇到了这个错误。 gpg --fingerprint gpg: WARNING: unsafe ownership on configuration file `/home/dyla
我遵循本教程:https://help.github.com/articles/signing-commits-using-gpg/ 我尝试像这样提交时签名: https://github.com/s
我从 brew 安装了 GPG。 brew install gpg 它是 gnupg2-2.0.30_2。 当我提交时,我确实收到一条错误消息: You need a passphrase to un
在我添加 docker GPG key 时设置 docker 存储库 cmd- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | su
我全新安装了 Linux Mint 14。安装了 Thunderbird 和 Enigmail。 生成我的 key ,得到一个 friend 的公钥,导入它。 给我的 friend 发了一封加密的电子
我是 Unix 和 ksh 脚本编写的新手。我写了一个解密 gpg 消息的脚本。我收到此错误,我不知道如何解决。我希望有人可以查看我的脚本并帮助我弄清楚发生了什么。感谢您提供的任何帮助。 这是错误:
我正在尝试在我的 ubuntu 机器上安装 chirpstack。尝试设置 key 时出现以下错误。 jonny@jonny-ubuntu:~$ sudo gpg --keyserver keyser
我正在为 Web 开发设置新机器 (macOS Sierra),我已经完成 brew install gpg 安装了 gpg2 和 gpg-agent。我已经从旧 Mac 上的 ~.gnupg 复制了
我正在使用以下命令 gpg --keyserver hkp://pool.sks-keyservers.net --send-keys 按照本文的指导https://getstream.io/blo
尝试将我们的基本镜像迁移到稳定的 Ubuntu 18.04,当我们尝试添加我们的 gpg key 时,出现此错误: root@77ff14f29cab:/# apt-key add apt-key.g
我运行的是GitHub工作流,过去我曾多次使用该工作流将代码发布到Nexus.它现在正在失败。我已经有一段时间没有使用它了,所以我的原始密钥可能已经过期了……自从我创建它以来,已经超过3年了,我不记得
我收到一个错误: gpg: no default secret key: No secret key gpg: [stdin]: clearsign failed: No secret key GPG
如何在 Scala 中解密 OpenPGP 加密文件?我有公钥和私钥,并且 gpg --output file.txt --decrypt file.txt.gpg 有效。 最佳答案 从 PR 到 h
我是一名优秀的程序员,十分优秀!