Gradle发布项目到 maven 之novoda/bintray-release(3)

novoda/bintray-release

使用这个插件上传比较简单,只需要两步就可以

  1.在项目根目录下的 build.gradle 添加插件依赖

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.novoda:bintray-release:0.9'
}
}

allprojects {
repositories {
google()
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
  1. 在开源库的目录中 build.gradle 中配置上传的信息,同样配置到文件的最后。  
apply plugin: 'com.novoda.bintray-release'
publish {
repoName = "maven"
userOrg = 'youaccount'
groupId = 'com.test.novoad'
artifactId = 'test-novoad'
publishVersion = '1.0.0'
desc = 'novoad bintraybuild project'
website = 'https://github.com/you project'
}
  1. 发布我们的开源项目,在 Terminal 输入以下命令,替换 BINTRAY_USERNAME 和 BINTRAY_KEY 为你自己的 user 和 API key,执行命令之前需 Gradle Build。

  4.在终端输入命令

./gradlew clean build bintrayUpload -PbintrayUser=BINTRAY_USERNAME -PbintrayKey=BINTRAY_KEY -PdryRun=false

 可以到上传成功

可能不同版本会有差异详情请参考

https://github.com/novoda/bintray-release

https://github.com/novoda/bintray-release/wiki中文

转载于:https://www.cnblogs.com/mingfeng002/p/10255896.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值