apply plugin: 'java'

//START SNIPPET assign-artifact
task myJar(type: Jar)

artifacts {
    archives myJar
}
//END SNIPPET assign-artifact

//START SNIPPET uploading
repositories {
    flatDir {
        name "fileRepo"
        dirs "repo"
    }
}

uploadArchives {
    repositories {
        add project.repositories.fileRepo
        ivy {
            userName "username"
            password "pw"
            url "http://repo.mycompany.com"
        }
    }
}
//END SNIPPET uploading

//START SNIPPET publish-repository
uploadArchives {
    repositories {
        ivy {
            userName "username"
            password "pw"
            url "http://repo.mycompany.com"
        }
    }
}
//END SNIPPET publish-repository
