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".

36 comments:

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

    Cheers,

    Sacha
    CEO CloudBees, Inc.

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

    Cheers,
    Vladimir

    ReplyDelete
  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.

    ReplyDelete
  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 http://www.gradle.org/lists or one of these great guys - http://twitter.com/#!/bmuschko or http://twitter.com/#!/breskeby or the "Gradle father" himself http://twitter.com/#!/hans_d

    ReplyDelete
  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 {
    mavenCentral()
    }
    ....

    Only then could I add deps to the dependencies block.

    It's simple but hope this helps someone.
    Regards,
    Marco.

    ReplyDelete
  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.

    ReplyDelete
  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.

    ReplyDelete
  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 http://best-college-essay.com/ for best essays.

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

    ReplyDelete
  10. This comment has been removed by the author.

    ReplyDelete
  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.
    https://aussieessaywriter.com.au/thesis-writers/

    ReplyDelete
  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

    ReplyDelete
  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.

    ReplyDelete
  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

    ReplyDelete
  15. Nice knowledge gaining article. This post is really the best on this valuable topic. seohouse

    ReplyDelete
  16. 아주 좋습니다. 필요한 지식을 찾았습니다. 귀하의 게시물에서 일부 정보를보고 참조하겠습니다. 감사합니다 사설토토

    ReplyDelete
  17. Thanks for sharing this information. I really like your blog post very much. You have really shared a informative and interesting blog post . Pressure washing

    ReplyDelete
  18. thank you for sharing this information. very useful and informative best natural toothpaste for toddlers

    ReplyDelete
  19. 유용한 정보를 공유해 주셔서 감사합니다. 메이저사이트

    ReplyDelete
  20. It can be furthermore a wonderful write-up it's my job to surely liked looking at. It isn't really actually day-to-day it's my job to acquire the means to learn everything. 토토커뮤니티

    ReplyDelete
  21. That is certainly on top of that a superb send i always basically liked mastering. It may not be everyday that any of us store the chance to determine the one thing. 토토안전사이트

    ReplyDelete
  22. On my website you'll see similar texts, write what you think paginas web tijuana

    ReplyDelete
  23. It is somewhat fantastic, and yet check out the advice at this treat. ktm dealer

    ReplyDelete
  24. I feel a lot more people need to read this, very good info windshield crack repair

    ReplyDelete
  25. 이 멋진 단락을 이곳에서 공유 해주신이 웹 페이지의 소유자에게 진심으로 감사드립니다. 토토

    ReplyDelete
  26. 정말 감동했습니다! 모든 것이 매우 개방적이며 문제를 명확하게 설명합니다. 그것은 진정한 사실을 담고 있습니다. 귀하의 웹 사이트는 매우 가치가 있습니다. 공유 해주셔서 감사합니다 메이저사이트

    ReplyDelete
  27. I always prefer to such type of blog which provides some latest info. commercial pressure washing

    ReplyDelete
  28. Very Nice Blog Thanks for sharing This Useful information. Water Filtration

    ReplyDelete