使用谷歌云存储托管的Maven存储库 [英] Use google cloud storage to hosting maven repository

查看:203
本文介绍了使用谷歌云存储托管的Maven存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Android Studio 1.1上使用Gradle,我可以使用maven-publish插件。有了这个,我可以发布到仓库。



我可以使用谷歌云存储托管一个maven仓库吗?



感谢

解决方案

或者我必须创建一个Bitbucket / Github来做这件事?

只有当您不需要每秒更新一次以上的工件和依赖项时,您才可以将Google Cloud Storage Bucket作为远程Maven存储库来托管工件和依赖项。尽管您可以在Google云端存储分区中创建的对象数量没有限制,并且跨多个对象的写入没有限制,但每个对象的更新限制为每秒一次;所以对单个对象的快速写入不会扩展。



也就是说,您可以将Google Cloud Storage Bucket配置为网站并将其用作远程存储库。



默认情况下,Maven将从中央存储库下载。要覆盖这个,你需要在你的pom.xml中指定你的GCS Bucket,如为镜像库使用镜像



要将您的工件上传到您的存储桶,您必须在〜/ .m2 / settings中使用用户名和密码进行身份验证.xml文件。用户名和密码需要从 Google Cloud Console 中检索:
在菜单中左侧选择存储→设置>>互操作性。
如果在互用存储访问密钥下列出了任何密钥,请选择创建新密钥。
使用访问密钥作为用户名,使用Secret作为密码


I use Gradle on Android Studio 1.1, I can use the "maven-publish" Plugin. With this one, I can publish to repositories.

Can I use the google cloud storage to host a maven repository?

Or I have to create a Bitbucket/Github to make this?

Thanks

解决方案

You can have a Google Cloud Storage Bucket act as a remote maven repository to host your artifacts and dependencies only if you do not require the need to have those artifacts and dependencies updated more than once per second. While there is no limit on the number of objects that you can create in a Google Cloud Storage bucket, and there is no limit to writes across multiple objects, there is an Update limit on each object of once per second; so rapid writes to a single object won’t scale.

That being said, you can configure a Google Cloud Storage Bucket as a Website and use it as your remote repository.

By default, Maven will download from the central repository. To override this, you need to specify your GCS Bucket in your pom.xml as shown in Using Mirrors for Repositories.

To upload your artifacts to your bucket you must authenticate with a username and password in your ~/.m2/settings.xml file. The username and password need to be retrieved from the Google Cloud Console: In the menu on the left select Storage → Settings > > Interoperability. If no keys are listed under Interoperable storage access keys, select "Create a new key". Use the Access Key as username, and Secret as the password

这篇关于使用谷歌云存储托管的Maven存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆