0

所以我有一个 Bintray 存储库,但我很难从 gradle 上传到它。好吧,我的意思是版本管理没有按我想要的方式工作,目前对于我上传的每个 .jar,我必须在我的配置和依赖项中增加版本。我知道这不是应该的方式。我的问题是如何使用 Bintray 自动化/实现 VCS 标记。现在我的上传配置看起来像这样(使用 bintray 插件):

bintray {
user = "$bintrayUser"
key = "$bintrayKey"
publications = ['maven']
dryRun = false
publish = true
pkg {
    repo = "$targetBintrayRepo"
    name = "$targetBintrayPackage"
    desc = ''
    websiteUrl = "$programWebsiteUrl"
    issueTrackerUrl = "$programIssueUrl"
    vcsUrl = "$programVcsUrl"
    licenses = ["$programLicense"]
    labels = []
    publicDownloadNumbers = true

    version {
        name = "$programVersion"
        released = new java.util.Date()
        vcsTag = "$programVcsTag"
    }

}
}

我的变量是:

def programVersion = '0'
def programVcsTag = '0.0.0'
def programGroup = 'com.gmail.socraticphoenix'
def targetBintrayRepo = 'Main'
def targetBintrayPackage = 'java-api'
def programLicense = 'MIT'
def programWebsiteUrl = 'https://github.com/meguy26/PlasmaAPI'
def programIssueUrl = 'https://github.com/meguy26/PlasmaAPI/issues'
def programVcsUrl = 'https://github.com/meguy26/PlasmaAPI.git'

然而这里没有出现任何标签,并且再次运行发布(即使使用不同的 vcs 标签)会导致版本已存在错误。( Could not upload to 'https://api.bintray.com/content/meguy26/Main/java-api/0/com/gmail/socraticphoenix/PlasmaAPI/0/PlasmaAPI-0.jar': HTTP/1.1 409 Conflict [message:Unable to upload files: An artifact with the path 'com/gmail/socraticphoenix/PlasmaAPI/0/PlasmaAPI-0.jar' already exists])

对不起,如果我很笨,但我不明白为什么它不起作用,我填写了所有适当的变量(我想)

4

1 回答 1

1

Bintray 不支持每个版本的多个标签。版本是一个唯一的字符串。如果您想从具有不同标签的同一版本发布某些内容,请使用您的程序版本和标签组成一个 Bintray 版本字符串,例如"$programVersion-$programVcsTag"

于 2015-11-23T17:48:47.630 回答