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中文


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM