Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use google cloud storage to hosting maven repository

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

like image 278
David Cesar Santos Avatar asked Apr 02 '15 08:04

David Cesar Santos


1 Answers

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

like image 51
Jordan Avatar answered Sep 27 '22 22:09

Jordan