发布项目到中央库的一些常见问题
来源:互联网 发布:南平seo快速优化软件 编辑:程序博客网 时间:2024/06/05 06:27
1 无法 close and release
问题描述:mvn clean deploy之后在Nexus staging repository(https://oss.sonatype.org/#welcome)中找不到项目,无法close和release
原因:maven 插件 nexus-staging-maven-plugin 中的 autoReleaseAfterClose 属性设置为 true 了。所以
mvn release
时自动上传到 staging repository ,并且自动执行了 close->release->drop 三步曲。而 drop 之后就没有了。<plugin> <groupId>org.sonatype.plugins</groupId> <artifactId>nexus-staging-maven-plugin</artifactId> <version>1.6.7</version> <extensions>true</extensions> <configuration> <serverId>ossrh</serverId> <nexusUrl>https://oss.sonatype.org/</nexusUrl> <autoReleaseAfterClose>true</autoReleaseAfterClose> </configuration></plugin>
解决方法:这个根本不用解决。。。可以在sonatype公有库里查看到你的项目 https://oss.sonatype.org/content/groups/public/ 。过两个小时在中央库也可以查到了。
- 如果想体验一把close和release,可以把 autoReleaseAfterClose 属性设置为false。这样在
mvn release
之后会在 Nexus staging repository 里看见你刚传上来的,选中之后可以手动 close 并 release 了,release 时会显示自动 drop。
2 无法更新项目
问题描述:当第一次部署完成后,更改了项目的代码,继续发布。会发现在 https://oss.sonatype.org/content/groups/public/ 中能看到更新了。但是中央库和maven库没有更新。
原因:发布更新后的项目时候使用了相同的版本号。尽管sonatype允许重新发布一个已存在的版本,但是maven库和中央库是不允许的,这会使得下载了之前发布的那些项目因为你的改动而出问题。
官方回应:Sonatype policy prohibits to removal or any other modification of artifacts after they’ve been published to Central. If you wish to provide updated artifacts via Maven Central, you have to deploy a new version. Even though oss.sonatype.org allows for re-publishing over a existing version, those artifacts will NOT overwrite what’s on Maven Central, and that’s by design. Our policies exist because if you release artifacts and delete or change them after people have already started depending on them, any changes will cause existing builds to break.
So, in summary, if want to publish updated artifacts, please increment your version number and deploy them as new artifacts.
- 解决方法:更新项目继续发布时,需要修改版本号。
- 发布项目到中央库的一些常见问题
- 发布项目到中央库
- 发布java项目到maven中央库
- 将项目发布到Maven中央库
- 将项目发布到Maven中央库
- Android studio项目发布到Maven中央库
- 发布安卓项目到maven中央库
- 发布本地项目到中央maven仓库
- 发布项目到maven中央仓库
- 将构建发布到中央库的那些坑
- 将项目发布到 maven 中央仓库踩过的坑
- Java开源项目发布到maven中央仓库
- 如何发布自己的 jar 包到 maven 中央仓库
- 使用Android Studio将开源库发布到Jcenter中央库
- Spring项目的一些常见问题
- maven项目的一些常见问题
- [Maven实战]发布maven项目到中央仓库(Central Repository)
- 【转】发布Maven构件到中央仓库
- div 中各种边框
- HDU 3820 Golden Eggs(最大独立集)
- UVa-101 The Blocks Problem(栈模拟)
- Windows下Eclispe远程开发Mapreduce程序
- SSH协议(1)-工作原理及过程
- 发布项目到中央库的一些常见问题
- Redis系列之 《Redis入门》
- 【perl】cpan 非root安装perl模块
- Picasso的封装(二)
- Qt使用 消息队列框架 RabbitMQ
- Qt渐变之线性渐变
- 图解用HTML5的popstate如何玩转浏览器历史记录
- 常用布局
- Oracle数据导入导出没有想像的难吧只要做对了这些就不会出错