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 gradle.properties 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 gradle.properties file:

repoUser=user123
repoPassword=123abc

Then in your build.gradle add the following:


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

9 comments:

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

    ReplyDelete
  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

    ReplyDelete
  3. Thankyou For Giving Useful Article Information.
    Python
    VMWARE
    Learn...More

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

    ReplyDelete
  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

    ReplyDelete
  6. It is essential to note the 토토사이트 house rules at totally different casino operators will vary barely in certain circumstances. Whether the dealer must stand on 17, if you can split that pair of beautiful aces and so on. Be positive to examine them, make yourself conscious of any variations and play accordingly.

    ReplyDelete