pom.xml文件修改完毕后,现在进行其他准备。如果还没修改pom那么请参阅该系列的第一篇。
1. 生成为软件数字签名所需的key。这里用到的工具是GPG。这个工具在Git Bash和Linux中可以直接运行。否则可以到这里下载。
GPG准备好以后,可以运行:
gpg --gen-key
出现如下提示后输入1:
在如下提示后输入想要的KEY的位数,没有特别需要的话直接回车也可以:
接着会出现询问KEY的有效期,默认这是0,也就是说永远不过期:
接着输入y并回车确认永久有效。然后会出现下面的提示,要求输入你的真实姓名:
根据提示输入姓名,邮箱和备注后,然后会提示输入用来保护密钥的密码(passphrase),如果不需要密码的话直接回车,如果输入了密码那么一定要记住,这个密码在后面会用到。接下来系统会要求你输入一些随机字符,在键盘的字母和符号上乱按就可以了,不过别按回车。
生成成功以后会出现信息:
public and secret key created and signed
要查看现有的公钥,输入:
gpg --list-keys
输出的格式是这个样子的:
pub 2048R/8743ASD9 2013-11-12
uid 姓名 (备注) <邮箱>
sub 2048R/874234DA 2013-11-12
pub代表的是公钥。旁边2048R代表生成的位数,斜杠后面的字符串就是这个key的ID。
类似地,查看私钥,输入:
而输出格式也类似:
sec 2048R/8743ASD9 2013-11-12
uid 姓名 (备注) <邮箱>
sub 2048R/874234DA 2013-11-12
为了保险起见,最好备份私钥:
gpg --export -a 私钥ID > private_key.asc
这样密钥就保存起来了。以后要重新导入的话只需要:
gpg --import private_key.asc
2. 生成了key以后,按照Sonatype的要求,我们需要把公钥上传到服务器上。输入:
gpg --keyserver hkp://pool.sks-keyservers.net --send-keys 公钥ID
这个服务器地址是Sonatype规定的,因此不需要修改。
3. 下一步,就要像Sonatype提出申请了。首先,要到
这里申请他们的Jira帐号。获得帐号以后,到
这里提交一个申请ticket。
Project要选
Support - Open Source Project Repository Hosting,
Issue Type选
New Project。
再次提醒:groupId的写法非常重要,要么使用自己拥有的域名。要么使用项目托管的子域名,例如com.github.username。为了节省时间,如果使用的是自己拥有的域名,那么可以在description里写清楚,否则客服有可能会问,这样就一个来回就需要一个工作日了。
等客服帮你创建好了仓库,会把ticket改成Fixed并在上面加注释。
3. 修改settings.xml文件。这里主要是添加Sonatype的帐号信息,以便发布的时候使用。
<server>
<id>portlettester-releases</id>
<username>xxx</username>
<password>xxx</password>
</server>
这里的id要和pom.xml文件里面<distributionManagement>的repository id对应,用户名和密码则是Sonatype的Jira帐号和密码。
- 大小: 8.5 KB
- 大小: 6.1 KB
- 大小: 10.7 KB
- 大小: 11.4 KB
分享到:
相关推荐
Maven仓库 该项目将以Maven存储库的形式发布TeamVK公开发布的Java资源。 如何使用 为了使用此Maven存储库,您可以使用各种插件(用于您的构建系统,例如Gradle和... mavenCentral() github("teamvk", "maven-repositor
Maven artifact is available from maven central repository. Just add dependency in your pom.xml: org.jamel.dbf dbf-reader 0.0.3 Supported fields types DBF field type Returned as character ...
Use the jcenter() or mavenCentral() repository. repositories { jcenter() mavenCentral() } Then pick a module. Core dependencies { implementation ...
Maven发布动作GitHub Action用于自动发布Maven软件包总览这个动作执行Maven deploy生命周期阶段为Maven提供您的GPG密钥和密码,以便您可以使用maven-gpg-plugin对工件进行签名向Maven提供您的Nexus凭据,以便它可以...
Some modules of project contain dependencies not included in Maven Central - to build such modules you need first install these dependencies in your local repository. To do this, please, download ...
Prebuilt JARs are available from the central Maven repository or the Sonatype Maven repository. Alternatively, you can get the latest code from Git and build it yourself: git clone git://github....
Build Status ... Changelog See what is new in version 1.4.9 released on 19th September... mavenCentral() } } dependencies { compile 'com.loopj.android:android-async-http:1.4.9' } development snapshots ...
mavenCentral() } allprojects { repositories { google() jcenter() maven { url 'https://jitpack.io' } mavenCentral() } } 依赖项{实现'com.github.gyadministrator:CustomDownSelect:1.2'} Maven...
我们在Maven Central中有一个发布库,但其中存在该版本,因此不会经常更新。 因此,我建议使用来获取最新发行版本(例如master分支或可用标签)。 有关如何包括依赖项的说明,请单击上面的链接或作为Maven项目的...
Linux Redis嵌入式服务器用于Java集成测试Maven依赖Maven Central: < dependency> < groupId>com.github.kstyrc</ groupId> < artifactId>embedded-redis</ artifactId> < version>0.6</ version></ dependency> ...
central 之前就可以使用了。 参考 Maven 将以下内容添加到 pom.xml: < repositories > < repository > < id >jitpack.io</ id > < url >https://jitpack.io</ url > </ repository > </ ...
central 之前就可以使用了。 参考 Maven 将以下内容添加到 pom.xml: < repositories > < repository > < id >jitpack.io</ id > < url >https://jitpack.io</ url > </ repository > </ ...
NavigationTabStrip 导航选项卡条具有平滑的交互作用。 您可以在检查示例应用程序。 警告 This library is not more supported.... mavenCentral() maven { url ' http://dl.bintray.com/gigamole/maven
SlideImageView 简单方便的库,使您可以在视图中滑动图像。 您可以在检查示例应用程序。 警告 This library is not more supported.... mavenCentral() maven { url ' http://dl.bintray.com/gigamole/maven
maven central) <repository> <id>jitpack.io</id> <url>https://jitpack.io</url></repository>添加依赖 <dependency> <groupId>...在您的测试课中: @Ruleprivate ContainerRule container = new Conta
# Maven Central git clone https://github.com/CSTARS/gwt-esri.git # install gwt-esri into your local repository first cd gwt-esri mvn install # if this didn't fail then built/package up this exam
预览版本您可能想要访问新功能,而又不想等到Maven Central上发布了稳定的版本。 在这种情况下,您可以从获得最新的开发版本。 您所需pom.xml就是将以下内容放入pom.xml : < repositories> < repository> < id>...
The JAR files for specific child modules or platforms can also be obtained individually from the Maven Central Repository. We can also have everything downloaded and installed automatically with: ...