Nexus download with credentials


I’m using Nexus and I want Gradle to use an user with password for downloading the dependencies.

This is my repository configuration:

repositories {

mavenRepo name: ‘Nexus’, url: “http://$nexusServer:$nexusPort/nexus/content/groups/public” }

How can I apply the credentials?


Have a look in the gradle userguide at

there is an example on how to pass credentials to your repository definition

Thanks for the qick response. Now it works!