简体   繁体   English

将OSS库发布发布到jcenter和maven-central

[英]Publishing OSS library release to jcenter and maven-central

I'd like to publish my OSS library to be available in both jcenter and maven-central repositories. 我想发布我的OSS库,以便在jcentermaven-central存储库中都可用。 I have 2 questions related with this topic: 我有2个与此主题相关的问题:

  1. Should I publish by my own to both repositories, or there is some automated sync between them, so will be enough to publish only to one of them? 我应该自己发布到两个存储库,还是它们之间存在一些自动同步,那么只发布一个存储库就足够了吗? If there is a sync, which one is the primary source and which when is mirrored? 如果有同步,哪一个是主要来源,哪个是镜像?

  2. I'd like to perform publish automatically from gradle, using some gradle plugin. 我想使用gradle插件从gradle自动执行发布。 Is there any single plugin, being able to work with both repositories? 是否有任何单个插件,能够使用这两个存储库?

  1. JCenter is a super-set of Maven-Central and it syncs automatically with the package published to Maven-Central, so essentially artifacts published to Maven-Central will be automatically synced and available in JCenter as well. JCenter是Maven-Central的超级集合,它与发布到Maven-Central的软件包自动同步,因此发布到Maven-Central的工件基本上会自动同步并在JCenter中可用。
  2. Gradle has two plugins supporting publishing to several repositories types , including Maven-Central and JCenter: (1) A "legacy" maven plugin and (2) a new incubating maven-publish plugin . Gradle有两个插件支持发布到几个存储库类型 ,包括Maven-Central和JCenter: (1) “遗留” maven插件(2)一个新的孵化maven-publish插件

For sure you need to publish to only one, and another one should pick it up from there. 当然,你只需要发布一个,另一个应该从那里拿起它。 The question is which one to select? 问题是选择哪一个?

Although @amnon-shochot's solution works, I'd suggest much easier solution: doing it vice-versa and going with Bintray as a main distribution platform. 虽然@ amnon-shochot的解决方案有效,但我建议使用更简单的解决方案:反之亦然,并将Bintray作为主要的分发平台。

Publishing to Bintray is much easier than publishing to Maven Central, and Bintray supports a very easy way to sync whatever you published to Bintray's JCenter to Maven Central. 发布到Bintray要比发布到Maven Central容易得多,Bintray支持一种非常简单的方法来将您发布的任何内容同步到Bintray的JCenter到Maven Central。

Also, most of Gradle users already prefer jcenter() over mavenCentral() cause it's faster, more reliable, gives you much more as a publisher and more secure . 此外,大多数Gradle用户已经更喜欢jcenter()不是mavenCentral()因为它更快,更可靠, 为您提供更多的发布商更安全的服务

You can publish to Bintray from Gradle using Bintray Gradle plugin , which support verity of methods to specify what should be published (configurations, publications, filesets, etc.) 您可以使用Bintray Gradle插件从Gradle发布到Bintray,该插件支持指定应发布内容的方法的真实性(配置,出版物,文件集等)


I am with JFrog , the company behind Bintray and [artifactory] , see my profile for details and links. 我与JFrog ,公司背后的Bintray[artifactory的] ,看看我的配置文件的详细信息和链接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM