kelemen / netbeans-gradle-project

This project is a NetBeans plugin able to open Gradle based Java projects. The implementation is based on Geertjan Wielenga's plugin.
170 stars 57 forks source link

NetBeans 9 – Exception while executing a Gradle command on old Gradle versions #377

Open ExE-Boss opened 6 years ago

ExE-Boss commented 6 years ago

NB-Gradle version: 2.0.0.1 2.0.0.2

The following exception gets thrown every time I do anything with a Gradle project that uses Gradle 3.5 or older and requires executing a gradle command, on both JDK 8 and 9 projects:

    java.lang.IllegalArgumentException: Could not determine java version from '9.0.4'.
        at org.gradle.api.JavaVersion.toVersion(JavaVersion.java:70)
        at org.gradle.api.JavaVersion.current(JavaVersion.java:80)
        at org.gradle.internal.jvm.UnsupportedJavaRuntimeException.assertUsingVersion(UnsupportedJavaRuntimeException.java:29)
        at org.gradle.tooling.internal.consumer.ConnectorServices.checkJavaVersion(ConnectorServices.java:57)
        at org.gradle.tooling.internal.consumer.ConnectorServices.createConnector(ConnectorServices.java:35)
        at org.gradle.tooling.GradleConnector.newConnector(GradleConnector.java:85)
        at org.netbeans.gradle.project.model.DefaultGradleModelLoader.createGradleConnector(DefaultGradleModelLoader.java:161)
        at org.netbeans.gradle.project.model.DefaultGradleModelLoader.loadModelWithProgress(DefaultGradleModelLoader.java:539)
        at org.netbeans.gradle.project.model.DefaultGradleModelLoader.fixProjectLoadKey(DefaultGradleModelLoader.java:365)
        at org.netbeans.gradle.project.model.DefaultGradleModelLoader.lambda$fetchModelWithoutPersistentCache$4(DefaultGradleModelLoader.java:416)
        at org.netbeans.gradle.project.tasks.GradleDaemonManager.runNonBlockingGradleTask(GradleDaemonManager.java:32)
        at org.netbeans.gradle.project.tasks.GradleDaemonManager.lambda$submitGradleTask$1(GradleDaemonManager.java:117)
        at org.jtrim2.executor.TaskExecutor.lambda$execute$0(TaskExecutor.java:94)
        at org.jtrim2.executor.CancelableTasks.complete(CancelableTasks.java:112)
        at org.jtrim2.executor.AbstractTaskExecutor$SubmittedTask.execute(AbstractTaskExecutor.java:112)
        at org.jtrim2.executor.SingleThreadedExecutor$QueuedItem.runTask(SingleThreadedExecutor.java:858)
        at org.jtrim2.executor.SingleThreadedExecutor$QueuedItem.access$900(SingleThreadedExecutor.java:844)
        at org.jtrim2.executor.SingleThreadedExecutor$Impl$Worker.executeTask(SingleThreadedExecutor.java:762)
        at org.jtrim2.executor.SingleThreadedExecutor$Impl$Worker.processQueue(SingleThreadedExecutor.java:773)
        at org.jtrim2.executor.SingleThreadedExecutor$Impl$Worker.run(SingleThreadedExecutor.java:807)
        at org.jtrim2.executor.SingleThreadedExecutor$Impl.lambda$createOwnedWorkerThread$0(SingleThreadedExecutor.java:430)
        at java.base/java.lang.Thread.run(Thread.java:844)
ExE-Boss commented 6 years ago

Turns out this got fixed in version 2.0.0.2

ExE-Boss commented 6 years ago

This still occurs when building a Gradle project that uses older versions of Gradle (eg. 3.5 or earlier).

kelemen commented 6 years ago

This is a Gradle issue. It is actually Gradle who throws an exception and not the plugin when I try to query the Java and Gradle version via the Tooling API of Gradle. I recommend you to set a newer version of Gradle for the project (you can do that in the project properties if you do not want to change the wrapper).

ExE-Boss commented 6 years ago

Unfortunately, the project I’m experiencing this with depends on an old plugin that requires Gradle 3 or older and trying to build it on Gradle 4 causes the plugin to break.

A possible way to at least partially fix without breaking odd plugins might be to separate the version of Gradle used to execute commands and the version of Gradle used for actually using inside this plugin.

kelemen commented 6 years ago

Does running the script still requires Java 9? If not (and I would guess so, if it requires Gradle 3), then you can set platform for build scripts to JDK 8 in the project properties.

ExE-Boss commented 6 years ago

That’s what I tried, but then the plugin tries to invoke the Tooling API from Gradle 3, which is unable to interface with Java 9 that NetBeans runs on.

kelemen commented 6 years ago

Can you try to set it in the global settings too if it helps? In Misc./Gradle/Script and Tasks

kelemen commented 6 years ago

Also, can you post the "script-platform" entry within your .nb-gradle-properties?

kelemen commented 6 years ago

Sorry, I got a bit distracted. It is not about the JDK version ...

kelemen commented 6 years ago

Doubly distracted, it is. Oh my god :)

ExE-Boss commented 6 years ago

Knowing a real world example that this occurs in might potentially help you with solving this:

kelemen commented 6 years ago

I was not able to reproduce it regardless how I tried. I realized the your PR got merged, so I attempted to test it with the commit prior merge. Are you sure that the exception stack trace is the same as in your original report even with NB-Gradle 2.0.0.2?

ExE-Boss commented 6 years ago

I have netbeans_jdkhome set to point to JDK 9.0.4 if that helps.

Here’s the full stack trace with “Prefer wrapper” checked:

  Requested project: [redacted]\NOVA-Core

  Stack trace:
    org.gradle.tooling.GradleConnectionException: Could not create an instance of Tooling API implementation using the specified Gradle distribution 'https://services.gradle.org/distributions/gradle-3.5-bin.zip'.
        at org.gradle.tooling.internal.consumer.loader.DefaultToolingImplementationLoader.create(DefaultToolingImplementationLoader.java:110)
        at org.gradle.tooling.internal.consumer.loader.CachingToolingImplementationLoader.create(CachingToolingImplementationLoader.java:44)
        at org.gradle.tooling.internal.consumer.loader.SynchronizedToolingImplementationLoader.create(SynchronizedToolingImplementationLoader.java:43)
        at org.gradle.tooling.internal.consumer.connection.LazyConsumerActionExecutor.onStartAction(LazyConsumerActionExecutor.java:101)
        at org.gradle.tooling.internal.consumer.connection.LazyConsumerActionExecutor.run(LazyConsumerActionExecutor.java:83)
        at org.gradle.tooling.internal.consumer.connection.CancellableConsumerActionExecutor.run(CancellableConsumerActionExecutor.java:45)
        at org.gradle.tooling.internal.consumer.connection.ProgressLoggingConsumerActionExecutor.run(ProgressLoggingConsumerActionExecutor.java:58)
        at org.gradle.tooling.internal.consumer.connection.RethrowingErrorsConsumerActionExecutor.run(RethrowingErrorsConsumerActionExecutor.java:38)
        at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:55)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
        at java.base/java.lang.Thread.run(Thread.java:844)
        at org.gradle.tooling.internal.consumer.BlockingResultHandler.getResult(BlockingResultHandler.java:46)
        at org.gradle.tooling.internal.consumer.DefaultModelBuilder.get(DefaultModelBuilder.java:50)
        at org.netbeans.gradle.project.model.DefaultGradleModelLoader.loadModelWithProgress(DefaultGradleModelLoader.java:525)
        at org.netbeans.gradle.project.model.DefaultGradleModelLoader.lambda$fetchModelWithoutPersistentCache$4(DefaultGradleModelLoader.java:394)
        at org.netbeans.gradle.project.tasks.GradleDaemonManager.runNonBlockingGradleTask(GradleDaemonManager.java:32)
        at org.netbeans.gradle.project.tasks.GradleDaemonManager.lambda$submitGradleTask$1(GradleDaemonManager.java:117)
        at org.jtrim2.executor.TaskExecutor.lambda$execute$0(TaskExecutor.java:94)
        at org.jtrim2.executor.CancelableTasks.complete(CancelableTasks.java:133)
        at org.jtrim2.executor.AbstractTaskExecutor$SubmittedTask.execute(AbstractTaskExecutor.java:112)
        at org.jtrim2.executor.SingleThreadedExecutor$QueuedItem.runTask(SingleThreadedExecutor.java:858)
        at org.jtrim2.executor.SingleThreadedExecutor$QueuedItem.access$900(SingleThreadedExecutor.java:844)
        at org.jtrim2.executor.SingleThreadedExecutor$Impl$Worker.executeTask(SingleThreadedExecutor.java:762)
        at org.jtrim2.executor.SingleThreadedExecutor$Impl$Worker.processQueue(SingleThreadedExecutor.java:773)
        at org.jtrim2.executor.SingleThreadedExecutor$Impl$Worker.run(SingleThreadedExecutor.java:807)
        at org.jtrim2.executor.SingleThreadedExecutor$Impl.lambda$createOwnedWorkerThread$0(SingleThreadedExecutor.java:430)
        at java.base/java.lang.Thread.run(Thread.java:844)
    Caused by: java.lang.IllegalArgumentException: Could not determine java version from '9.0.4'.
        at org.gradle.api.JavaVersion.toVersion(JavaVersion.java:70)
        at org.gradle.api.JavaVersion.current(JavaVersion.java:80)
        at org.gradle.internal.jvm.UnsupportedJavaRuntimeException.assertUsingVersion(UnsupportedJavaRuntimeException.java:29)
        at org.gradle.tooling.internal.provider.DefaultConnection.configure(DefaultConnection.java:88)
        at org.gradle.tooling.internal.consumer.connection.AbstractPost12ConsumerConnection.configure(AbstractPost12ConsumerConnection.java:37)
        at org.gradle.tooling.internal.consumer.loader.DefaultToolingImplementationLoader.createConnection(DefaultToolingImplementationLoader.java:115)
        at org.gradle.tooling.internal.consumer.loader.DefaultToolingImplementationLoader.create(DefaultToolingImplementationLoader.java:93)
        at org.gradle.tooling.internal.consumer.loader.CachingToolingImplementationLoader.create(CachingToolingImplementationLoader.java:44)
        at org.gradle.tooling.internal.consumer.loader.SynchronizedToolingImplementationLoader.create(SynchronizedToolingImplementationLoader.java:43)
        at org.gradle.tooling.internal.consumer.connection.LazyConsumerActionExecutor.onStartAction(LazyConsumerActionExecutor.java:101)
        at org.gradle.tooling.internal.consumer.connection.LazyConsumerActionExecutor.run(LazyConsumerActionExecutor.java:83)
        at org.gradle.tooling.internal.consumer.connection.CancellableConsumerActionExecutor.run(CancellableConsumerActionExecutor.java:45)
        at org.gradle.tooling.internal.consumer.connection.ProgressLoggingConsumerActionExecutor.run(ProgressLoggingConsumerActionExecutor.java:58)
        at org.gradle.tooling.internal.consumer.connection.RethrowingErrorsConsumerActionExecutor.run(RethrowingErrorsConsumerActionExecutor.java:38)
        at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:55)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
        ... 1 more

And here’s trying to load it with Gradle 4.6: (ForgeGradle 1.2 is incompatible with Gradle 4+)

org.gradle.tooling.BuildException: Could not run build action using Gradle installation 'C:\ProgramData\chocolatey\lib\gradle\tools\gradle-4.6'.
    at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:51)
    at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:29)
    at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:41)
    at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:57)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
    at java.base/java.lang.Thread.run(Thread.java:844)
    at org.gradle.tooling.internal.consumer.BlockingResultHandler.getResult(BlockingResultHandler.java:46)
    at org.gradle.tooling.internal.consumer.DefaultBuildActionExecuter.run(DefaultBuildActionExecuter.java:60)
    at org.netbeans.gradle.model.GenericModelFetcher.getModels(GenericModelFetcher.java:168)
    at org.netbeans.gradle.project.model.NbGradle18ModelLoader$ProjectModelFetcher.getModels(NbGradle18ModelLoader.java:375)
    at org.netbeans.gradle.project.model.NbGradle18ModelLoader.loadModels(NbGradle18ModelLoader.java:64)
    at org.netbeans.gradle.project.model.DefaultGradleModelLoader.loadModelWithProgress(DefaultGradleModelLoader.java:533)
    at org.netbeans.gradle.project.model.DefaultGradleModelLoader.lambda$fetchModelWithoutPersistentCache$4(DefaultGradleModelLoader.java:394)
    at org.netbeans.gradle.project.tasks.GradleDaemonManager.runNonBlockingGradleTask(GradleDaemonManager.java:32)
    at org.netbeans.gradle.project.tasks.GradleDaemonManager.lambda$submitGradleTask$1(GradleDaemonManager.java:117)
    at org.jtrim2.executor.TaskExecutor.lambda$execute$0(TaskExecutor.java:94)
    at org.jtrim2.executor.CancelableTasks.complete(CancelableTasks.java:133)
    at org.jtrim2.executor.AbstractTaskExecutor$SubmittedTask.execute(AbstractTaskExecutor.java:112)
    at org.jtrim2.executor.SingleThreadedExecutor$QueuedItem.runTask(SingleThreadedExecutor.java:858)
    at org.jtrim2.executor.SingleThreadedExecutor$QueuedItem.access$900(SingleThreadedExecutor.java:844)
    at org.jtrim2.executor.SingleThreadedExecutor$Impl$Worker.executeTask(SingleThreadedExecutor.java:762)
    at org.jtrim2.executor.SingleThreadedExecutor$Impl$Worker.processQueue(SingleThreadedExecutor.java:773)
    at org.jtrim2.executor.SingleThreadedExecutor$Impl$Worker.run(SingleThreadedExecutor.java:807)
    at org.jtrim2.executor.SingleThreadedExecutor$Impl.lambda$createOwnedWorkerThread$0(SingleThreadedExecutor.java:430)
    at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: org.gradle.internal.exceptions.LocationAwareException: Build file '[redacted]\NOVA-Core\minecraft\1.7\build.gradle' line: 104
A problem occurred evaluating project ':minecraft:1.7'.
    at org.gradle.initialization.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:74)
    at org.gradle.initialization.MultipleBuildFailuresExceptionAnalyser.transform(MultipleBuildFailuresExceptionAnalyser.java:47)
    at org.gradle.initialization.StackTraceSanitizingExceptionAnalyser.transform(StackTraceSanitizingExceptionAnalyser.java:30)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:143)
    at org.gradle.initialization.DefaultGradleLauncher.getConfiguredBuild(DefaultGradleLauncher.java:110)
    at org.gradle.internal.invocation.GradleBuildController$2.call(GradleBuildController.java:87)
    at org.gradle.internal.invocation.GradleBuildController$2.call(GradleBuildController.java:84)
    at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:152)
    at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:100)
    at org.gradle.internal.invocation.GradleBuildController.configure(GradleBuildController.java:84)
    at org.gradle.tooling.internal.provider.runner.ClientProvidedBuildActionRunner.run(ClientProvidedBuildActionRunner.java:64)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$1.run(RunAsBuildOperationBuildActionRunner.java:43)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:40)
    at org.gradle.tooling.internal.provider.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:51)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:49)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:32)
    at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:39)
    at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:25)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:80)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:53)
    at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:57)
    at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:32)
    at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
    at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
    at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
    at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:64)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:29)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:59)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:44)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:45)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:30)
    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
    at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
    at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
    at org.gradle.util.Swapper.swap(Swapper.java:38)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
    at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
    at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:62)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
    at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:82)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
    at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:295)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: org.gradle.api.GradleScriptException: A problem occurred evaluating project ':minecraft:1.7'.
    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:92)
    at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl$2.run(DefaultScriptPluginFactory.java:204)
    at org.gradle.configuration.ProjectScriptTarget.addConfiguration(ProjectScriptTarget.java:77)
    at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:209)
    at org.gradle.configuration.BuildOperationScriptPlugin$1.run(BuildOperationScriptPlugin.java:61)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
    at org.gradle.configuration.BuildOperationScriptPlugin.apply(BuildOperationScriptPlugin.java:58)
    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:41)
    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:26)
    at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:34)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.doConfigure(LifecycleProjectEvaluator.java:64)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.access$100(LifecycleProjectEvaluator.java:34)
    at org.gradle.configuration.project.LifecycleProjectEvaluator$ConfigureProject.run(LifecycleProjectEvaluator.java:110)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:50)
    at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:667)
    at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:136)
    at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:35)
    at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:62)
    at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:38)
    at org.gradle.initialization.DefaultGradleLauncher$ConfigureBuild.run(DefaultGradleLauncher.java:261)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
    at org.gradle.initialization.DefaultGradleLauncher.configureBuild(DefaultGradleLauncher.java:173)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:132)
    ... 62 more
Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin [id 'forge']
    at org.gradle.api.internal.plugins.DefaultPluginManager.doApply(DefaultPluginManager.java:150)
    at org.gradle.api.internal.plugins.DefaultPluginManager.apply(DefaultPluginManager.java:125)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyType(DefaultObjectConfigurationAction.java:120)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$200(DefaultObjectConfigurationAction.java:38)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$3.run(DefaultObjectConfigurationAction.java:86)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:143)
    at org.gradle.api.internal.project.AbstractPluginAware.apply(AbstractPluginAware.java:46)
    at org.gradle.api.internal.project.ProjectScript.apply(ProjectScript.java:34)
    at org.gradle.api.Script$apply.callCurrent(Unknown Source)
    at build_4cjzxv3w4wdw4br8gebzi4pya.run([redacted]\NOVA-Core\minecraft\1.7\build.gradle:104)
    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:90)
    ... 94 more
Caused by: org.gradle.api.ProjectConfigurationException: You must set the Minecraft Version!
    at net.minecraftforge.gradle.user.patch.UserPatchExtension.getApiVersion(UserPatchExtension.java:64)
    at net.minecraftforge.gradle.user.patch.UserPatchExtension_Decorated.getApiVersion(Unknown Source)
    at net.minecraftforge.gradle.user.patch.UserPatchBasePlugin.getApiVersion(UserPatchBasePlugin.java:267)
    at net.minecraftforge.gradle.user.patch.UserPatchBasePlugin.getApiVersion(UserPatchBasePlugin.java:38)
    at net.minecraftforge.gradle.user.UserBasePlugin.resolve(UserBasePlugin.java:285)
    at net.minecraftforge.gradle.user.patch.UserPatchBasePlugin.resolve(UserPatchBasePlugin.java:367)
    at net.minecraftforge.gradle.user.patch.UserPatchBasePlugin.resolve(UserPatchBasePlugin.java:38)
    at net.minecraftforge.gradle.delayed.DelayedBase.resolve(DelayedBase.java:84)
    at net.minecraftforge.gradle.delayed.DelayedFile.resolveDelayed(DelayedFile.java:37)
    at net.minecraftforge.gradle.delayed.DelayedFile.resolveDelayed(DelayedFile.java:7)
    at net.minecraftforge.gradle.delayed.DelayedBase.call(DelayedBase.java:50)
    at org.gradle.util.GUtil.uncheckedCall(GUtil.java:458)
    at org.gradle.util.DeferredUtil.unpack(DeferredUtil.java:37)
    at org.gradle.api.internal.file.AbstractFileResolver.convertObjectToFile(AbstractFileResolver.java:113)
    at org.gradle.api.internal.file.AbstractBaseDirFileResolver.doResolve(AbstractBaseDirFileResolver.java:69)
    at org.gradle.api.internal.file.AbstractFileResolver.resolve(AbstractFileResolver.java:85)
    at org.gradle.api.internal.file.AbstractFileResolver.resolve(AbstractFileResolver.java:67)
    at org.gradle.process.internal.DefaultProcessForkOptions.setWorkingDir(DefaultProcessForkOptions.java:66)
    at org.gradle.process.internal.DefaultProcessForkOptions.workingDir(DefaultProcessForkOptions.java:70)
    at org.gradle.api.tasks.JavaExec.workingDir(JavaExec.java:408)
    at org.gradle.api.tasks.JavaExec_Decorated.workingDir(Unknown Source)
    at net.minecraftforge.gradle.user.UserBasePlugin.createExecTasks(UserBasePlugin.java:812)
    at net.minecraftforge.gradle.user.UserBasePlugin.tasks(UserBasePlugin.java:700)
    at net.minecraftforge.gradle.user.UserBasePlugin.applyPlugin(UserBasePlugin.java:94)
    at net.minecraftforge.gradle.user.patch.UserPatchBasePlugin.applyPlugin(UserPatchBasePlugin.java:44)
    at net.minecraftforge.gradle.common.BasePlugin.apply(BasePlugin.java:154)
    at net.minecraftforge.gradle.common.BasePlugin.apply(BasePlugin.java:49)
    at org.gradle.api.internal.plugins.ImperativeOnlyPluginTarget.applyImperative(ImperativeOnlyPluginTarget.java:42)
    at org.gradle.api.internal.plugins.RuleBasedPluginTarget.applyImperative(RuleBasedPluginTarget.java:50)
    at org.gradle.api.internal.plugins.DefaultPluginManager.addPlugin(DefaultPluginManager.java:164)
    at org.gradle.api.internal.plugins.DefaultPluginManager.access$200(DefaultPluginManager.java:47)
    at org.gradle.api.internal.plugins.DefaultPluginManager$AddPluginBuildOperation.run(DefaultPluginManager.java:252)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
    at org.gradle.api.internal.plugins.DefaultPluginManager.doApply(DefaultPluginManager.java:144)
    ... 104 more
Caused by: java.lang.NullPointerException
    ... 141 more

Building this on NetBeans 8.2 or on Travis CI which use JDK 8 works fine.

kelemen commented 6 years ago

Can you send me the content of your .nb-gradle-properties? You can remove the auxiliary and tasks tags if you want to (actually, I'm mostly interested in the script-platform part).

It seems to me that the plugin is trying to set JDK 9 for the Tooling API (or does not set anything at all). I can't reproduce the issue and can't spot anything suspicious, so the only thing I can do is to ask you to do some debugging of the plugin (built from the nb9 branch) if you have the time. The wiki has some description on how to setup the plugin for debugging. The part where the plugin queries the required platfrom and sets it is in DefaultModelBuilderSetup.

ExE-Boss commented 6 years ago

Here’s my entire .nb-gradle-properties file.

Anyway, the <script-platform> is set to 1.8:

  <script-platform>
    <spec-name>j2se</spec-name>
    <spec-version>1.8</spec-version>
  </script-platform>

Also, if I comment out the following from settings.gradle:

include "minecraft:1.8"
include "minecraft:1.7"

Then I can build and test the root project on JDK 9, but I can’t build the Minecraft wrappers.

kelemen commented 6 years ago

Your .nb-gradle-properties seems to be fine. So, I would guess that the problem depends on how your (or where) JDK was installed. That is, probably JavaPlatformUtils.tryChooseFromOrderedPlatforms cannot properly select the appropriate JDK from the Java platform list of NB. Do you by any chance see any of these in the logs:

Of course, the {number} parts are replaced in the logs.

kelemen commented 6 years ago

I have pushed some changes to the nb9 branch. Can you build it and check the logs? In particular, I'm interested if the message "Found no usable platforms" appears or not for you (and if so, what is the complete message).

Given this issue, you would probably need to use NB 8.2 to build the plugin (otherwise it might get built using JDK 9) or set it up as described on the wiki page.