gradle发布jar到nexus和本地

group 'cn.zytx'
version '1.0-SNAPSHOT'

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

sourceCompatibility = 1.8

repositories {
    mavenCentral()
}
dependencies {
    compile 'com.jfinal:jfinal:2.2'
    compile 'ch.qos.logback:logback-core:1.2.3'
    compile 'ch.qos.logback:logback-classic:1.2.3'
}
//Maven仓库的URL
//注意需要在防火墙的高级规则中添加允许入站规则http://bbs.csdn.net/topics/390728329
def MAVEN_REPO_RELEASE_URL= 'http://192.168.2.189:8081/nexus/content/repositories/releases/'
def MAVEN_REPO_SNAPSHOT_URL= 'http://192.168.2.189:8081/nexus/content/repositories/snapshots/'
//登录nexus ossde的用户名
def NEXUS_USERNAME='admin'
//登录nexus oss的密码
def NEXUS_PASSWORD='admin123'
def ARTIFACT_ID = 'server-common'
// type
def TYPE = 'jar'
//description
def DESCRIPTION = 'This is Token service included add,edit,delete,query'

uploadArchives {
    configuration = configurations.archives
    repositories {
        mavenDeployer {
            snapshotRepository(url: MAVEN_REPO_SNAPSHOT_URL) {
                authentication(userName: NEXUS_USERNAME, password: NEXUS_PASSWORD)
            }
            repository(url: MAVEN_REPO_RELEASE_URL) {
                authentication(userName: NEXUS_USERNAME, password: NEXUS_PASSWORD)
            }
            repository(url: uri('C:\\Users\\xiongshiyan\\.m2\\repository')) //定义本地maven仓库的地址
            repository(url: uri('C:\\Users\\xiongshiyan\\.gradle\\caches\\modules-2\\files-2.1')) //定义本地Gradle仓库的地址
            pom.project {
                version version
                artifactId ARTIFACT_ID
                groupId group
                packaging TYPE
                description DESCRIPTION
            }
        }
    }
} 
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值