Wednesday, August 17, 2011

Using Gradle with CloudBees' Maven Repository

CloudBees is one of the best current Platform as a Service providers. And it is one of the few (maybe only one) who provides tools such as Jenkins as a service too. Its Dev@cloud also provides 2GB free Maven repository which could be a perfect solutions for a lot of home-brewed libraries in your company. This article will show you how to use this free repository in Gradle builds.

Uploading to the repository
There are a lot of reasons why you should want to upload your library to the repository.  The most obvious one is managing the dependencies more easily. If you build your libraries with Gradle you can set up uploading to the CloudBees' Maven repository by adding a few more configuration to your build script.

Gradle to CloudBees

There is no magic about this configuration. You just have to use proper wagon library to support webdav protocol and use the right protocol in the URLs. If you write them manually you should check twice that you use "dav" not "webdav" as the protocol specification.
To upload your artifacts to the repository you just run gradle uploadArchives task.

Using the repository
Using the repository is little bit trickier because to make it work you must use the right server realm.
Using CloudBees repository in Gradle script

The only important part is setting the credentials. The resolver needs the same realm as the server which is "accountname repository".


  1. Glad you like CloudBees! Thanks for the interesting post.


    CEO CloudBees, Inc.

  2. Thank you Sacha,
    It's pleasure to use such a great platform,
    Keep doing the right things right.


  3. Do you know how to make gradle use the cloudbees repo so that it does not download the dependencies in every build?

    I have tried setting the maven repo url to the cloudbees public repo already, but it still downloads from maven central.

  4. I'm sorry, but I don't know. I don't think this is a CloudBees specific issue.
    Try to ask on the Gradle mailing list or one of these great guys -!/bmuschko or!/breskeby or the "Gradle father" himself!/hans_d

  5. Great blog post! I did have a small issues in resolving dependencies though. In order to solve this I had to do the following:

    apply plugin: 'groovy'
    repositories {

    Only then could I add deps to the dependencies block.

    It's simple but hope this helps someone.

  6. Thanks Marco for pointing out the problem and much more for solving it immediately . I've updated the Gits so everything should be all right know.

  7. absolutely wonderful !! was always wondering how to do something like this. tere is a new v 1.0.0 gradle plugin for cloud foundry. It lets us upload war's to a PaaS provier who uses cloud foundry layer, but it does not solve this problem as well as this solution. thank you.

  8. This has actually been so much informative and wonderful blog from the many perspective, now I'v been intended to see it through more successful ways. See for best essays.

  9. outstanding publish, very informative. We ponder why the opposite professionals of this sector don’t fully grasp this. free amazon gift card codes

  10. This comment has been removed by the author.

  11. These experts are always available for their clients by providing them even emergency services. If anyone wants the topic within certain hours then also the professionals are there to help you out. Overall the conclusion is that to reduce the workload of writing, the students can enjoy the benefit of experts.

  12. I quite like ones putting up. Their okay to view that you make clear throughout words and phrases while using heart as well as solution on this crucial subject can often be without difficulty considered. idm crack

  13. If you have already completed your paper you should not hurry up as you have to check it with the highest attention if you want to receive the highest grades. In this case you may need to use a grammar checker designed by the expert writing services.

  14. I'm keen on ones write-up. It truly is beneficial to discover people verbalize on the cardiovascular system in addition to understanding within this significant theme is usually simply discovered. windows 8.1 activator