Scala plugin does not work in Java 8 RC

The Scala plugin does not work in the latest Java 8 RC (it works fine on Java 7). Scala itself works on Java 8 RC.

java version “1.8.0” Java™ SE Runtime Environment (build 1.8.0-b129) Java HotSpot™ Server VM (build 25.0-b69, mixed mode)

Gradle 1.10

Build time: 2013-12-17 09:28:15 UTC Build number: none Revision: 36ced393628875ff15575fa03d16c1349ffe8bb6

Groovy: 1.8.6 Ant: Apache Ant™ version 1.9.2 compiled on July 8 2013 Ivy: 2.2.0 JVM: 1.8.0 (Oracle Corporation 25.0-b69) OS: Linux 3.2.0-58-generic-pae i386

java.lang.NullPointerException at org.gradle.api.DefaultTask.(DefaultTask.java:33) at org.gradle.api.internal.ConventionTask.(ConventionTask.java:28) at org.gradle.api.tasks.SourceTask.(SourceTask.java:36) at org.gradle.api.tasks.scala.ScalaDoc.(ScalaDoc.java:28) at org.gradle.api.tasks.scala.ScalaDoc_Decorated.(Unknown Source) at org.gradle.api.internal.DependencyInjectingInstantiator.newInstance(DependencyInjectingInstantiator.java:62) at org.gradle.api.internal.ClassGeneratorBackedInstantiator.newInstance(ClassGeneratorBackedInstantiator.java:36) at org.gradle.api.internal.project.taskfactory.TaskFactory$1.call(TaskFactory.java:124)

Can you provide the exact error message?

15:52:06.276 [ERROR] [org.gradle.BuildExceptionReporter]

15:52:06.479 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception. 15:52:06.480 [ERROR] [org.gradle.BuildExceptionReporter]

15:52:06.480 [ERROR] [org.gradle.BuildExceptionReporter] * Where: 15:52:06.480 [ERROR] [org.gradle.BuildExceptionReporter] Build file ‘/home/mst/Dev/aiq2/build.gradle’ line: 29 15:52:06.480 [ERROR] [org.gradle.BuildExceptionReporter]

15:52:06.481 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong: 15:52:06.481 [ERROR] [org.gradle.BuildExceptionReporter] A problem occurred evaluating root project ‘aiq2’. 15:52:06.481 [ERROR] [org.gradle.BuildExceptionReporter] > Could not create task of type ‘ScalaDoc’. 15:52:06.484 [ERROR] [org.gradle.BuildExceptionReporter]

15:52:06.485 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is: 15:52:06.486 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.GradleScriptException: A problem occurred evaluating root project ‘aiq2’. 15:52:06.486 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:54) 15:52:06.487 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:156) 15:52:06.487 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:38) 15:52:06.487 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:25) 15:52:06.487 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:34) 15:52:06.487 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:55) 15:52:06.488 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:507) 15:52:06.488 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:82) 15:52:06.488 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:31) 15:52:06.488 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:142) 15:52:06.488 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113) 15:52:06.489 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81) 15:52:06.489 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:64) 15:52:06.489 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33) 15:52:06.489 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24) 15:52:06.489 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:35) 15:52:06.490 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26) 15:52:06.490 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50) 15:52:06.490 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:171) 15:52:06.490 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201) 15:52:06.490 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174) 15:52:06.490 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170) 15:52:06.491 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139) 15:52:06.491 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33) 15:52:06.491 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22) 15:52:06.491 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.Main.doAction(Main.java:46) 15:52:06.491 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45) 15:52:06.492 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.Main.main(Main.java:37) 15:52:06.492 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50) 15:52:06.492 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32) 15:52:06.492 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.GradleMain.main(GradleMain.java:23) 15:52:06.492 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30) 15:52:06.492 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:127) 15:52:06.493 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:58) 15:52:06.493 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: org.gradle.api.tasks.TaskInstantiationException: Could not create task of type ‘ScalaDoc’. 15:52:06.493 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.TaskFactory$1.call(TaskFactory.java:126) 15:52:06.493 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.TaskFactory$1.call(TaskFactory.java:121) 15:52:06.493 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.AbstractTask.injectIntoNewInstance(AbstractTask.java:148) 15:52:06.493 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.TaskFactory.createTaskObject(TaskFactory.java:121) 15:52:06.494 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.TaskFactory.createTask(TaskFactory.java:81) 15:52:06.494 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory.createTask(AnnotationProcessingTaskFactory.java:99) 15:52:06.494 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.DependencyAutoWireTaskFactory.createTask(DependencyAutoWireTaskFactory.java:39) 15:52:06.494 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.DefaultTaskContainer.create(DefaultTaskContainer.java:52) 15:52:06.494 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.DefaultTaskContainer.create(DefaultTaskContainer.java:85) 15:52:06.494 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.tasks.TaskContainer$create$0.call(Unknown Source) 15:52:06.495 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.plugins.scala.ScalaPlugin.configureScaladoc(ScalaPlugin.groovy:40) 15:52:06.495 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.plugins.scala.ScalaPlugin.this$2$configureScaladoc(ScalaPlugin.groovy) 15:52:06.495 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.plugins.scala.ScalaPlugin$this$2$configureScaladoc.callCurrent(Unknown Source) 15:52:06.495 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.plugins.scala.ScalaPlugin.apply(ScalaPlugin.groovy:32) 15:52:06.495 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.plugins.scala.ScalaPlugin.apply(ScalaPlugin.groovy) 15:52:06.496 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultPluginContainer.providePlugin(DefaultPluginContainer.java:104) 15:52:06.496 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultPluginContainer.addPluginInternal(DefaultPluginContainer.java:68) 15:52:06.496 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultPluginContainer.apply(DefaultPluginContainer.java:34) 15:52:06.496 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyPlugin(DefaultObjectConfigurationAction.java:101) 15:52:06.496 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$200(DefaultObjectConfigurationAction.java:32) 15:52:06.497 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$3.run(DefaultObjectConfigurationAction.java:72) 15:52:06.497 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:114) 15:52:06.497 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.AbstractPluginAware.apply(AbstractPluginAware.java:39) 15:52:06.497 [ERROR] [org.gradle.BuildExceptionReporter] at build_pr41h1h6jesckft2o1blb4a40$_run_closure1.doCall(/home/mst/Dev/aiq2/build.gradle:29) 15:52:06.497 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:58) 15:52:06.497 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:130) 15:52:06.498 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:91) 15:52:06.498 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.AbstractProject.configure(AbstractProject.java:903) 15:52:06.498 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.AbstractProject.configure(AbstractProject.java:908) 15:52:06.498 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.AbstractProject.allprojects(AbstractProject.java:895) 15:52:06.498 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:246) 15:52:06.499 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:134) 15:52:06.499 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:147) 15:52:06.499 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.groovy.scripts.BasicScript.methodMissing(BasicScript.java:79) 15:52:06.499 [ERROR] [org.gradle.BuildExceptionReporter] at build_pr41h1h6jesckft2o1blb4a40.run(/home/mst/Dev/aiq2/build.gradle:26) 15:52:06.499 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:52) 15:52:06.499 [ERROR] [org.gradle.BuildExceptionReporter] … 33 more 15:52:06.500 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.NullPointerException 15:52:06.500 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.DefaultTask.(DefaultTask.java:33) 15:52:06.500 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.ConventionTask.(ConventionTask.java:28) 15:52:06.500 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.tasks.SourceTask.(SourceTask.java:36) 15:52:06.500 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.tasks.scala.ScalaDoc.(ScalaDoc.java:28) 15:52:06.501 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.tasks.scala.ScalaDoc_Decorated.(Unknown Source) 15:52:06.501 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.DependencyInjectingInstantiator.newInstance(DependencyInjectingInstantiator.java:62) 15:52:06.501 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.ClassGeneratorBackedInstantiator.newInstance(ClassGeneratorBackedInstantiator.java:36) 15:52:06.501 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.TaskFactory$1.call(TaskFactory.java:124) 15:52:06.501 [ERROR] [org.gradle.BuildExceptionReporter] … 68 more 15:52:06.501 [ERROR] [org.gradle.BuildExceptionReporter]

Confirmed with 1.8.0-b128 and Gradle 1.10/1.11. Raised GRADLE-3023. Thanks for the report.

any changes? jdk 8 is out and we can’t upgrade because of this error

No update so far. (You can check this yourself on the JIRA issue.)

This is fixed in Gradle 2.1, and might be backported to 2.0 before the release. However, as of Scala 2.11.1 it doesn’t seem to be possible to run the Scala compiler under Java 8 (I haven’t had any luck), which makes this look less urgent.

The compiler in Scala 2.10.3 works with Java 8, so I really think you should fix this in the next release of Gradle.