Use google cloud storage to hosting maven repository

≯℡__Kan透↙ 提交于 2019-12-08 19:14:29

问题


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


回答1:


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




回答2:


You should setup a private Maven repository using https://github.com/renaudcerrato/appengine-maven-repository.

Make a separate App Engine project yourcompanyname-maven.appspot.com.

Setup the username / password configuration and you're all set.



来源:https://stackoverflow.com/questions/29408256/use-google-cloud-storage-to-hosting-maven-repository

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!