Friday, 5 February 2016

How to set up repository authentication with Gradle

  • Setting up repository authentication with Gradle
In the previous post I showed you how to move a project from maven to Gradle. One of the issues I had was that authenticated repositories no longer worked (in Maven they were using the setting.xml file in the .m2 directory). I'm sure this is standard knowledge for any Gradle user but it took a little figuring out as a Maven user.

First create a file called and same it into the same directory as your build.gradle. It doesn't have to live there but it's a good place to start. See more here.

Add the following lines to the file:


Then in your build.gradle add the following:

repositories {
    maven {
        credentials {
            username repoUser
            password repoPassword
        url "http://nexus........."


  1. This doesn't handle the security issue of publishing and keeping secrets in a repository though?

  2. Moreover, one may opt for custom java development to target the customers. As it is independent of the platform, it stays versatile, saving resources, time and money.
    web design lessons

  3. Thankyou For Giving Useful Article Information.

  4. Build your own home in a virtual world? Get the info about - avakin now!

  5. 77%OFF Coach Outlet Store-Coach Bags Clearance Sale,100% Popular
    New & Popular Ray Ban Sunglasses Outlet Store Online,2020-2021 Stylish
    Clearance Coach Store | 80%OFF Coach Bags Outlet On Sale Online
    Share Best Best Adidas Yeezys Store|100% New & Real Yeezy Boost For Sale
    2020 Nike Air For 1 Shoes Outlet For Men & Women, 68-85%OFF Cheap Sale
    Official Michael Kors Outlet Store Online,100% Cheap MK Bags Sale
    61-82%OFF Air Jordan Shoe Stores|Cheap Jordans Releases,Hot Sale