android - 将 GitHub Android 库发布到 Maven Central

标签 android maven gradle sonatype bintray

我工作了 2 天来部署我的 github 库 CircularImageView在 Maven Central 中使用它与这样的 gradle 依赖关系:

compile 'com.mikhaellopez:circularimageview:2.0.0'

我严格按照本教程进行操作:Publish an aar file to jCenter with Gradle但是没有什么可做的,我不能那样访问我的图书馆。

请帮助我知道我做错了什么..

链接:

编辑:10/14/2015

tutorial第 16 步最终将所有内容与 Maven Central 同步。您需要一个用户 token 密码。我如何获得它?

Bintray 回答:

Hi, The "User token password" is not taken from Bintray, it can be found in your Maven Central account. Please see further information on syncing with Maven here: https://bintray.com/docs/usermanual/uploads/uploads_syncingartifactswithmavencentral.html Regards Bintray Team

最后,不清楚,但“用户 token 密码”实际上对应于您的Sonatype 帐户的密码。现在项目正常同步,但是我仍然无法访问项目:

Failed to resolve: com.mikhaellopez:circularimageview:2.0.0

最佳答案

在bintray中可以看到所有的库HERE . 我意识到我的图书馆很好,但路径不同。

的确,在 Android Studio 中 module name 非常重要。所以我在“circularimageview”中重命名为“CircularImageView-Library”。我再次与新版本同步,现在可以使用了。

我可以像这样使用 gradle 访问我的图书馆:

compile 'com.mikhaellopez:circularimageview:2.0.1'

我编辑教程:https://github.com/lopspower/gradle-jcenter-publish

关于android - 将 GitHub Android 库发布到 Maven Central,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33104152/

相关文章:

java - 在 RecyclerView 中单击 Collection 夹项目时出现问题

java - Android Slider 中的 NoClassDefFoundError 错误

android - YouTube API 在全屏模式下变为空白 - Android

maven - 如何编译所有模块但只安装/部署选定的模块?

android - Gradle Firebase AdMob 依赖项与 app compat v7 28.0.0 冲突

android - Osmdrord/osmbonuspack - 自定义导航箭头(通过 MyLocationNewOverlay?)

java - Maven - 排除传递依赖

java - 这个 java 应用程序可以在 Heroku 上运行吗?

java - 错误: Unfortunately you can't have non-Gradle Java modules and > Android-Gradle modules in one project

java - Gradle 4.10.2 需要 Java 7 或更高版本才能运行。从命令行运行 gradle 时您当前正在使用 Java 6