简体   繁体   English

如何为 Android 库创建私有 Maven 存储库 (bitbucket)?

[英]How to create private Maven Repository (bitbucket) for Android Libraries?

Ok, I've wasted 2 days on researching and googling and still can't find the answer.好吧,我已经浪费了 2 天的时间进行研究和谷歌搜索,但仍然找不到答案。

Problem:问题:

I have a couple of libraries, which I would like to share within my company.我有几个图书馆,我想在我的公司内分享。 Currently, they are packed in AAR files.目前,它们被打包在 AAR 文件中。 I want to create bitbucket repository, push there my AAR's and use them in future applications in easy way : in gradle.build you just need to add compile "com.mycompanyname.libraryname:version or something like that.我想创建 bitbucket 存储库,将我的 AAR 推送到那里,并以简单的方式在未来的应用程序中使用它们在 gradle.build 中,您只需要添加compile "com.mycompanyname.libraryname:version或类似的内容。

Question

Could someone share the detailed guide, please?有人可以分享详细的指南吗? Becouse I've wasted 2 days researching already=/ I've also found wagon-git plugin, but I've no idea how to use it, since their documentation is quite bad for ppl which are new to maven.因为我已经浪费了 2 天的研究时间 =/ 我还发现了 wagon-git 插件,但我不知道如何使用它,因为他们的文档对于 Maven 的新手 ppl 来说非常糟糕。 Is there must be pom.xml in all my libraries?我的所有库中都必须有 pom.xml 吗? What if my library depends on another libraries, is it possible to push it into one repository?如果我的库依赖于另一个库,是否可以将其推送到一个存储库中? How to use AAR libraries?如何使用 AAR 库? A lot of question and literally no answers.很多问题,实际上没有答案。 Please, any help would be much appreciated.请,任何帮助将不胜感激。

PS聚苯乙烯

As far as I understood, there must be one pom.xml in repository, and pom.xml in each AAR package.据我了解,repository 中必须有一个 pom.xml,每个 AAR 包中必须有 pom.xml。 I've tried this article .我试过这篇文章 But there are no explanation how to push to bitbucket and how to use AAR artifacts.但是没有解释如何推送到 bitbucket 以及如何使用 AAR 工件。

What you need is a Repository Manager.您需要的是存储库管理器。 Have a look here about what it means and what managers are out there.在这里查看它的含义以及管理人员在那里的含义。 I would recommend Sonatype's Nexus.我会推荐 Sonatype 的 Nexus。 Gradle works with any of these. Gradle 适用于其中任何一个。 Whether you can achieve something similar with just a Bitbucket repository I couldn't say.我不能说仅使用 Bitbucket 存储库就可以实现类似的功能。

设置私有 Maven 存储库并不容易,但也没有那么困难,这是示例,请查看setup-private-maven-repository

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

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