Gradle 打包上传至私有仓库配置
Posted fqybzhangji
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Gradle 打包上传至私有仓库配置相关的知识,希望对你有一定的参考价值。
allprojects{
apply plugin: ‘java‘
apply plugin: ‘idea‘
apply plugin: ‘maven‘
group ‘com.xxxxx.base‘
sourceCompatibility = 1.8
ext{
mavenUrl = "http://maven.xxxxx.com/nexus/content/groups/public/"
mavenThirdparty = "http://maven.xxxx.com/nexus/content/repositories/thirdparty"
mavenSnapshot = "http://maven.xxxx.com/nexus/content/repositories/Snapshot"
mavenThirdpartyUserName = "admin"
mavenThirdpartyPwd = "xxxxx"
mavenSnapshotUserName = "uploader"
mavenSnapshotPwd = "uploader"
packLogbackVersion = "0.0.1"
}
repositories {
maven {
url "${mavenUrl}"
}
}
}
//上传到nexus
uploadArchives {
repositories {
mavenDeployer {
repository(url: "${mavenThirdparty}") {
authentication(userName: "${mavenThirdpartyUserName}", password: "${mavenThirdpartyPwd}")
}
snapshotRepository(url: "${mavenSnapshot}") {
authentication(userName: "${mavenSnapshotUserName}", password: "${mavenSnapshotPwd}")
}
println "$version"
pom.version = "$version"
pom.artifactId = "$archivesBaseName"
pom.groupId = "$project.group"
}
}
}
以上是关于Gradle 打包上传至私有仓库配置的主要内容,如果未能解决你的问题,请参考以下文章
Android Gradle 插件将自定义 Gradle 插件上传到自建 Maven 仓库 ① ( Maven 仓库上传源码上传源码设置 | 自定义源码打包任务 | 自定义文档打包任务 )
Jenkins+Gradle+Docker打docker镜像包上传至s3