gradle如何配置发布maven包到nexus私服

// maven deploy config start
configurations {
    deployerJars
}

uploadArchives {
    repositories.mavenDeployer {
        configuration = configurations.deployerJars
        repository(url: "http://maven.coder4.com/nexus/content/repositories/releases/") {
            authentication(userName: "$mavenUser", password: "$mavenPass")
        }
        repository(url: "http://maven.coder4.com/nexus/content/repositories/snapshots/") {
            authentication(userName: "$mavenUser", password: "$mavenPass")
        }
    }
}

// maven deploy config end

以及插件的依赖

dependencies {
    deployerJars "org.apache.maven.wagon:wagon-http:2.2"
    .... 
}

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *