Grails(3.0.8)插件bintrayUpload返回HTTP / 1.1 - 禁止

时间:2015-10-13 05:29:12

标签: grails plugins publish grails-plugin bintray

bintrayUpload总是尝试将我的插件发布到grails / plugins而不是我的repo danieltribeiro / plugins。而且因为那个原因我被禁止了403。

* What went wrong:
Execution failed for task ':bintrayUpload'.
> Could not create package 'grails/plugins/my-plugin': HTTP/1.1 403 Forbidden [message:forbidden]

我在这里检查了类似问题的答案NullPointerExcpetion并尝试了所有提出的解决方案,没有幸运。包括Graeme Rocher Answer只更改名称并将userRepo留空。但无论我做什么,任务都会尝试上传到grails.plugins repo。

我的bintray插件是1.2

plugins {
    id "io.spring.dependency-management" version "0.5.2.RELEASE"
    id "com.jfrog.bintray" version "1.2"
}

我在Benoit tutorial之后的build.gradle上尝试了很多关于bintray闭包的配置。我创建了插件仓库,使用正确的值配置了env vars BINTRAY_USER和BINTRAY_KEY(否则它会丢弃401-Unauthorized)

这是我最后一次(不工作)的配置。

version "0.1-SNAPSHOT"
group "danieltribeiro.plugins" // Or your own user/organization

bintray {
  pkg {
    userOrg = 'danieltribeiro' // If you want to publish to an organization
    repo = 'plugins'
    name = "${project.name}"
    //issueTrackerUrl = "https://github.com/benorama/grails-$project.name/issues"
    //vcsUrl = "https://github.com/benorama/grails-$project.name"
    version {
      attributes = ['grails-plugin': "${project.group}:${project.name}"]
      name = project.version
    }
  }
}

为什么此任务继续POST到grails.plugins?

1 个答案:

答案 0 :(得分:1)

你正在使用:

apply from:'https://raw.githubusercontent.com/grails/grails-profile-repository/master/profiles/plugin/templates/bintrayPublishing.gradle'

采用默认的bintray配置。

覆盖此配置或对其进行评论并手动执行:

bintray {
    user = 'user'
    key = '*****'
    pkg {    
        userOrg = '' // 
        repo = 'nameRepo'
        licenses = project.hasProperty('license') ? [project.license] :['Apache-2.0']
        name = "$project.name"
        issueTrackerUrl = "yourGitHub"
        vcsUrl = "yourGitHub"
        version {
            attributes = ['grails-plugin': "$project.group:$project.name"]
            name = project.version
        }
    }
}