发布Grails 3插件时的NullPointerException [英] NullPointerException when publishing a Grails 3 plugin
问题描述
我正在尝试发布这个Grails 3 插件给Bintray ,请遵循本指南中的步骤。最后一步是运行
I'm trying to publish this Grails 3 plugin to Bintray, by following the steps in this guide. The final step is to run
gradle bintrayUpload
在项目根目录下的命令行上执行。当我这样做时,我收到以下错误消息:
on the command-line from the project root dir. When I do this, I get the following error message
FAILURE: Build failed with an exception.
* What went wrong:
java.lang.NullPointerException (no error message)
* Try:
Run with --info or --debug option to get more log output.
* Exception is:
java.lang.NullPointerException
at org.gradle.api.internal.tasks.DefaultTaskDependency.add(DefaultTaskDependency.java:109)
at org.gradle.api.internal.AbstractTask$11.run(AbstractTask.java:327)
at org.gradle.api.internal.tasks.TaskMutator.mutate(TaskMutator.java:37)
at org.gradle.api.internal.AbstractTask.dependsOn(AbstractTask.java:325)
at com.jfrog.bintray.gradle.BintrayPlugin$_apply_closure2_closure5.doCall(BintrayPlugin.groovy:96)
at com.jfrog.bintray.gradle.BintrayPlugin$_apply_closure2.doCall(BintrayPlugin.groovy:88)
问题的原因是什么?
根据以下建议,我做了以下 build.gradle 中的变化
Following the suggestions below, I've made the following changes in build.gradle
- 将bintray插件更新至版本1.2
- 已将
组org.grails.plugins
更改为组domurtag.plugins$ c
$ b
- updated the bintray plugin to version 1.2
- changed
group "org.grails.plugins"
togroup "domurtag.plugins"
失败:构建失败,出现异常。
FAILURE: Build failed with an exception.
- 发生了什么问题:执行任务'bintrayUpload'失败。
- What went wrong: Execution failed for task ':bintrayUpload'.
无法创建包'grails / plugins / org.grails.plugins:grails-simple-captcha':HTTP / 1.1
403 Forbidden [message:forbidden]
我已经添加了这些环境变量
I've added these environment variables
BINTRAY_USER=domurtag BINTRAY_KEY=my_api_key
错误消息表明403的原因是因为试图将插件发布到
grails / plugins
存储库(我无权访问) ,但我不知道为什么会发生这种情况?The error message suggests that the reason for the 403 is because an attempt is being made to publish the plugin to the
grails/plugins
repository (which I don't have access to), but I don't know why this is happening?推荐答案
我看到了我的Gradle构建完全相同的堆栈跟踪。我的Gradle构建脚本使用
com.jfrog.bintray
version 1.1。升级到版本1.2后,构建成功运行。I saw the exactly same stacktrace for my Gradle builds. My Gradle build script made use of
com.jfrog.bintray
version 1.1. After upgrading to version 1.2 the build runs successfully.这篇关于发布Grails 3插件时的NullPointerException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
- What went wrong: Execution failed for task ':bintrayUpload'.