上传
1. 在工程的build.gradle中添加
allprojects {
repositories {
//使用自己的仓库
mavenLocal()
}
}
2. 在module的build.gradle中添加
apply plugin: 'maven'
uploadArchives {
repositories.mavenDeployer {
repository(url: "http://ip:8081/repository/your repository name/") {
authentication(userName: "your username", password: "your password")
}
pom.version = "0.0.1"
pom.artifactId = "common-lib"
pom.groupId = "cn.r2r.platform.app"
}
}
3. 上传到nexus
使用
1. 在工程的build.gradle中添加
maven {
url "http://ip:8081/repository/cn.r2r.platform.app.common/"
}
在引用的模块中添加
compile 'cn.r2r.platform.app:common-lib:0.0.1'
本文介绍如何通过Gradle将构建的构件部署到Nexus仓库。主要步骤包括:配置工程的build.gradle文件来添加本地仓库;配置module的build.gradle文件以应用maven插件并设置上传参数;最后配置Nexus的URL以便进行构件的远程访问。
947

被折叠的 条评论
为什么被折叠?



