I have a Gradle project with the following uploadArchives configuration to publish its artifact to Nexus:
uploadArchives {
repositories {
mavenDeployer {
repository(url: 'http://releasesrepo')
snapshotRepository(url: 'http://snapshotsrepo')
}
}
}
As you see there are no credentials in this configuration.
This build will be run from Jenkins as a Freestyle project so I will just have to specify in Build - Invoke Gradle Script - Tasks -> build upload
What's the right way to configure the Nexus credentials from Jenkins and pass them to the Gradle taks (I don't want them in the Git repo with the source code)?