Deploying your artifacts to a remote Maven repository with Gradle is possible, but the official documentation is rather thin at the time of this writing. Worse, it tells you to use a version of wagon-ssh that ignores the provided password and prompt for it at the command line (use gradle -i to see its message).

So, without further ado, here is a build.gradle that uploads its artifact via scp with a password. It has been tested with Gradle 1.0-milestone-6.

apply plugin: 'java'
apply plugin: 'maven'

configurations {

repositories {

dependencies {
    //the one and only version that works
    deployerJars 'org.apache.maven.wagon:wagon-ssh:1.0-alpha-3'

uploadArchives {
    repositories.mavenDeployer {
        configuration = configurations.deployerJars
        uniqueVersion = false
        String username = 'me'
        String password = 'secret'
        repository(url: 'scp://') {
            authentication(userName: username, password: password)
        snapshotRepository(url: 'scp://') {
            authentication(userName: username, password: password)

Of course, in a real world scenario, it would be wiser to get the username and password from your or any other non-public file.