将Grails从3.0.1升级到3.0.8后,无法应用gradle war插件

时间:2015-10-13 15:32:17

标签: grails gradle

我有一个Grails应用程序,Grails版本3.0.1没有问题。我想将它升级到更新版的Grails。

但是,当我尝试将Grails依赖项更新为3.0.8(或.7,.6)时,运行'gradle build'任务时出现以下错误。

10:21:30.108 [ERROR] [org.gradle.BuildExceptionReporter] A problem occurred evaluating root project 'project'.
10:21:30.108 [ERROR] [org.gradle.BuildExceptionReporter] > Failed to apply plugin [id 'org.gradle.war']
10:21:30.108 [ERROR] [org.gradle.BuildExceptionReporter]    > Cannot execute null+null

错误的堆栈跟踪是:

    10:21:30.109 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
10:21:30.109 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'project'.
10:21:30.110 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(    DefaultScriptRunnerFactory.java:93)
10:21:30.110 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl$1.run(    DefaultScriptPluginFactory.java:148)
10:21:30.110 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.configuration.ProjectScriptTarget.addConfiguration(ProjectScriptTarget.java:72)
10:21:30.110 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(    DefaultScriptPluginFactory.java:153)
10:21:30.110 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:38    )
10:21:30.110 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:25    )
10:21:30.110 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(    ConfigureActionsProjectEvaluator.java:34)
10:21:30.111 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(    LifecycleProjectEvaluator.java:55)
10:21:30.111 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:491)
10:21:30.111 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:89)
10:21:30.111 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.    java:42)
10:21:30.111 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:35)
10:21:30.111 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.initialization.DefaultGradleLauncher$2.run(DefaultGradleLauncher.java:126)
10:21:30.111 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.internal.Factories$1.create(Factories.java:22)
10:21:30.112 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(    DefaultBuildOperationExecutor.java:90)
10:21:30.112 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(    DefaultBuildOperationExecutor.java:52)
10:21:30.112 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.    java:123)
10:21:30.112 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:33)
10:21:30.112 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:100)
10:21:30.112 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:94)
10:21:30.112 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(    DefaultBuildOperationExecutor.java:90)
10:21:30.112 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(    DefaultBuildOperationExecutor.java:62)
10:21:30.113 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:94)
10:21:30.113 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:83)
10:21:30.113 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(    InProcessBuildActionExecuter.java:94)
10:21:30.113 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner    .java:28)
10:21:30.113 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
10:21:30.113 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter    .java:43)
10:21:30.113 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter    .java:28)
10:21:30.113 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(    ContinuousBuildActionExecuter.java:77)
10:21:30.113 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(    ContinuousBuildActionExecuter.java:47)
10:21:30.114 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(    DaemonUsageSuggestingBuildActionExecuter.java:51)
10:21:30.114 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(    DaemonUsageSuggestingBuildActionExecuter.java:28)
10:21:30.114 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43)
10:21:30.114 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:170)
10:21:30.114 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(    CommandLineActionFactory.java:237)
10:21:30.115 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(    CommandLineActionFactory.java:210)
10:21:30.115 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.    java:35)
10:21:30.115 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.    java:24)
10:21:30.115 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(    CommandLineActionFactory.java:206)
10:21:30.115 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(    CommandLineActionFactory.java:169)
10:21:30.115 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
10:21:30.116 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
10:21:30.116 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.Main.doAction(Main.java:33)
10:21:30.116 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
10:21:30.116 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
10:21:30.116 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
10:21:30.116 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
10:21:30.116 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin [    id 'org.gradle.war']
10:21:30.116 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.plugins.DefaultPluginManager.doApply(DefaultPluginManager.java:160    )
10:21:30.116 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.plugins.DefaultPluginManager.apply(DefaultPluginManager.java:112)
10:21:30.116 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyType(    DefaultObjectConfigurationAction.java:112)
10:21:30.116 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$200(    DefaultObjectConfigurationAction.java:35)
10:21:30.117 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$3.run(    DefaultObjectConfigurationAction.java:79)
10:21:30.117 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(    DefaultObjectConfigurationAction.java:135)
10:21:30.117 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.project.AbstractPluginAware.apply(AbstractPluginAware.java:46)
10:21:30.117 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.plugins.PluginAware$apply.call(Unknown Source)
10:21:30.117 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.project.ProjectScript.apply(ProjectScript.groovy:34)
10:21:30.117 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.Script$apply$0.callCurrent(Unknown Source)
10:21:30.117 [ERROR] [org.gradle.BuildExceptionReporter]    at build_5ocov9dbopr4idkd2fje5zpqr.run(project/build.gradle:34)
10:21:30.118 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(    DefaultScriptRunnerFactory.java:91)
10:21:30.118 [ERROR] [org.gradle.BuildExceptionReporter]    ... 47 more
10:21:30.118 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.NullPointerException: Cannot execute null+null
10:21:30.118 [ERROR] [org.gradle.BuildExceptionReporter]    at org.grails.gradle.plugin.web.gsp.GroovyPagePlugin$_apply_closure5.doCall(GroovyPagePlugin.    groovy:66)
10:21:30.118 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:67)
10:21:30.118 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:130)
10:21:30.118 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:110)
10:21:30.118 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.AbstractTask.configure(AbstractTask.java:488)
10:21:30.119 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.AbstractTask.configure(AbstractTask.java:58)
10:21:30.119 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:59)
10:21:30.119 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.internal.Actions$FilteredAction.execute(Actions.java:202)
10:21:30.119 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.listener.ActionBroadcast.execute(ActionBroadcast.java:39)
10:21:30.119 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.DefaultDomainObjectCollection.doAdd(DefaultDomainObjectCollection.    java:165)
10:21:30.119 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.DefaultDomainObjectCollection.add(DefaultDomainObjectCollection.    java:159)
10:21:30.120 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.DefaultNamedDomainObjectCollection.add(    DefaultNamedDomainObjectCollection.java:81)
10:21:30.120 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.DefaultTaskContainer.create(DefaultTaskContainer.java:79)
10:21:30.120 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.DefaultTaskContainer.create(DefaultTaskContainer.java:97)
10:21:30.120 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.plugins.WarPlugin.apply(WarPlugin.java:74)
10:21:30.120 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.plugins.WarPlugin.apply(WarPlugin.java:38)
10:21:30.120 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.plugins.ImperativeOnlyPluginApplicator.applyImperative(    ImperativeOnlyPluginApplicator.java:35)
10:21:30.120 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.plugins.RuleBasedPluginApplicator.applyImperative(RuleBasedPluginApplicator.java:43)
10:21:30.121 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.plugins.DefaultPluginManager.doApply(DefaultPluginManager.java:144)
10:21:30.121 [ERROR] [org.gradle.BuildExceptionReporter]    ... 58 more

我相信这一行是异常发生的地方: https://github.com/grails/grails-core/blob/master/grails-gradle-plugin/src/main/groovy/org/grails/gradle/plugin/web/gsp/GroovyPagePlugin.groovy#L66

有谁知道我可以做些什么来解决这个问题?我是否需要在build.gradle文件中设置任何其他字段?

1 个答案:

答案 0 :(得分:1)

这似乎一直在发生,因为在我的build.gradle文件中,我在'war'插件之前应用了'org.grails.grails-gsp'插件。

在'grails-gsp'之前移动'war'插件后,错误就消失了。

https://github.com/grails/grails-core/issues/9361