When configuring upload of jars to a repository using wagon and scp according to the user guide the build freezes. When I turn on the info logging it turns out that gradle prompts me for password multiple times. This makes it impossible to use gradle in a continuous build system like, e.g Jenkins. Is there a way to get around this?
You can give the password in the authorization like this as described in the user guide: http://gradle.org/docs/current/userguide/maven_plugin.html#uploading_to_maven_repositories
uploadArchives {
repositories.mavenDeployer {
name = ‘sshDeployer’ // optional
configuration = configurations.deployerJars
repository(url: “scp://repos.mycompany.com/releases”) {
authentication(userName: “me”, password: “myPassword”)
}
} }
Philip
Yes, that is exactly what I have done (as I mentioned I’ve followed the user guide and copied the exact code snippet that you refer to), but gradle seem to ignore the configured password.
Can you please post the code snippet of your uploadArchives task, or wherever you are configuring the mavenDeployer? Additionally, the section of the log file that show Gradle requesting the password would be useful.
Hi, here it is. By the way, it works fine if I switch to FTP.
// Run gradle uploadArchives
apply plugin: ‘java’
apply plugin: ‘maven’ group = ‘com.cag.gradleex’ version = ‘0.0.1-SNAPSHOT’
configurations {
deployerJars
}
repositories {
mavenCentral()
}
dependencies {
deployerJars “org.apache.maven.wagon:wagon-ssh:2.2” }
uploadArchives {
repositories.mavenDeployer {
name = ‘sshDeployer’ // optional
configuration = configurations.deployerJars
repository(url: “scp://192.168.0.31/Users/developer/testrepo”) {
authentication(userName: “developer”, password: “xxxxxxx”)
}
} }