[GRADLE-1874] Tooling API: Avoid MissingPropertyException working with IntelliJ IDEA model Created: 27/Oct/11  Updated: 04/Jan/13  Resolved: 06/Dec/12

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Denis Zhdanov Assignee: Unassigned
Resolution: Not A Bug Votes: 0


 Description   

Try to import spring security project - http://static.springsource.org/spring-security/site/build.html

Result:
org.gradle.tooling.BuildException: Could not fetch model of type 'BasicIdeaProject' using Gradle installation '/home/denis/dev/gradle/gradle-1.0-milestone-5'.
at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:44)
at org.gradle.tooling.internal.consumer.DefaultAsyncConnection$3.run(DefaultAsyncConnection.java:73)
at org.gradle.messaging.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.gradle.messaging.remote.internal.PlaceholderException: org.gradle.api.LocationAwareException: Build file '/home/denis/dev/spring/spring-security/spring-security-spring-security/core/core.gradle' line: 52
A problem occurred evaluating project ':spring-security-core'.
at org.gradle.initialization.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:85)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:114)
at org.gradle.initialization.DefaultGradleLauncher.getBuildAnalysis(DefaultGradleLauncher.java:91)
at org.gradle.tooling.internal.provider.BuildModelAction.run(BuildModelAction.java:46)
at org.gradle.tooling.internal.provider.DelegatingBuildModelAction.run(DelegatingBuildModelAction.java:42)
at org.gradle.tooling.internal.provider.ConfiguringBuildAction.run(ConfiguringBuildAction.java:56)
at org.gradle.launcher.exec.DefaultGradleLauncherActionExecuter.execute(DefaultGradleLauncherActionExecuter.java:49)
at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:41)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:84)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:82)
at org.gradle.util.Swapper.swap(Swapper.java:38)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:82)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:45)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:48)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
at org.gradle.launcher.daemon.server.exec.HandleSleep.execute(HandleSleep.java:35)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
at org.gradle.launcher.daemon.server.exec.ReportExceptions.execute(ReportExceptions.java:36)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:24)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
at org.gradle.launcher.daemon.server.exec.ForwardOutput.execute(ForwardOutput.java:46)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
at org.gradle.launcher.daemon.server.exec.ReturnResult.execute(ReturnResult.java:32)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
at org.gradle.launcher.daemon.server.exec.UpdateDaemonStateAndHandleBusyDaemon.execute(UpdateDaemonStateAndHandleBusyDaemon.java:33)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
at org.gradle.launcher.daemon.server.exec.HandleStop.execute(HandleStop.java:34)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
at org.gradle.launcher.daemon.server.exec.CatchAndForwardDaemonFailure.execute(CatchAndForwardDaemonFailure.java:34)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
at org.gradle.launcher.daemon.server.exec.HandleClientDisconnectBeforeSendingCommand.execute(HandleClientDisconnectBeforeSendingCommand.java:21)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
at org.gradle.launcher.daemon.server.exec.StopConnectionAfterExecution.execute(StopConnectionAfterExecution.java:21)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
at org.gradle.launcher.daemon.server.exec.DefaultDaemonCommandExecuter.executeCommand(DefaultDaemonCommandExecuter.java:47)
at org.gradle.launcher.daemon.server.Daemon$1$1.run(Daemon.java:98)
... 4 more
Caused by: org.gradle.api.GradleScriptException: A problem occurred evaluating project ':spring-security-core'.
at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:54)
at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:127)
at org.gradle.configuration.BuildScriptProcessor.evaluate(BuildScriptProcessor.java:38)
at org.gradle.configuration.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:43)
at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:474)
at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:73)
at org.gradle.configuration.ProjectEvaluationConfigurer.execute(ProjectEvaluationConfigurer.java:23)
at org.gradle.configuration.ProjectEvaluationConfigurer.execute(ProjectEvaluationConfigurer.java:21)
at org.gradle.configuration.DefaultBuildConfigurer$1.execute(DefaultBuildConfigurer.java:38)
at org.gradle.configuration.DefaultBuildConfigurer$1.execute(DefaultBuildConfigurer.java:35)
at org.gradle.api.internal.project.AbstractProject.configure(AbstractProject.java:450)
at org.gradle.api.internal.project.AbstractProject.allprojects(AbstractProject.java:445)
at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:35)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:141)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:112)
at org.gradle.initialization.DefaultGradleLauncher.getBuildAnalysis(DefaultGradleLauncher.java:91)
at org.gradle.tooling.internal.provider.BuildModelAction.run(BuildModelAction.java:46)
at org.gradle.tooling.internal.provider.DelegatingBuildModelAction.run(DelegatingBuildModelAction.java:42)
at org.gradle.tooling.internal.provider.ConfiguringBuildAction.run(ConfiguringBuildAction.java:56)
at org.gradle.launcher.exec.DefaultGradleLauncherActionExecuter.execute(DefaultGradleLauncherActionExecuter.java:49)
at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:41)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:84)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:82)
at org.gradle.util.Swapper.swap(Swapper.java:38)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:82)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:45)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:48)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
at org.gradle.launcher.daemon.server.exec.HandleSleep.execute(HandleSleep.java:35)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
at org.gradle.launcher.daemon.server.exec.ReportExceptions.execute(ReportExceptions.java:36)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:24)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
at org.gradle.launcher.daemon.server.exec.ForwardOutput.execute(ForwardOutput.java:46)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
at org.gradle.launcher.daemon.server.exec.ReturnResult.execute(ReturnResult.java:32)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
at org.gradle.launcher.daemon.server.exec.UpdateDaemonStateAndHandleBusyDaemon.execute(UpdateDaemonStateAndHandleBusyDaemon.java:33)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
at org.gradle.launcher.daemon.server.exec.HandleStop.execute(HandleStop.java:34)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
at org.gradle.launcher.daemon.server.exec.CatchAndForwardDaemonFailure.execute(CatchAndForwardDaemonFailure.java:34)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
at org.gradle.launcher.daemon.server.exec.HandleClientDisconnectBeforeSendingCommand.execute(HandleClientDisconnectBeforeSendingCommand.java:21)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
at org.gradle.launcher.daemon.server.exec.StopConnectionAfterExecution.execute(StopConnectionAfterExecution.java:21)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
at org.gradle.launcher.daemon.server.exec.DefaultDaemonCommandExecuter.executeCommand(DefaultDaemonCommandExecuter.java:47)
at org.gradle.launcher.daemon.server.Daemon$1$1.run(Daemon.java:98)
at org.gradle.messaging.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64)
Caused by: groovy.lang.MissingPropertyException: Could not find property 'dependencies' on org.gradle.plugins.ide.idea.model.IdeaModule_Decorated@784504dd.
at org.gradle.api.internal.AbstractDynamicObject.propertyMissingException(AbstractDynamicObject.java:43)
at org.gradle.api.internal.AbstractDynamicObject.getProperty(AbstractDynamicObject.java:35)
at org.gradle.api.internal.CompositeDynamicObject.getProperty(CompositeDynamicObject.java:54)
at org.gradle.plugins.ide.idea.model.IdeaModule_Decorated.getProperty(Unknown Source)
at core_7b1r7p4grepm6n5m1341ai6o8k$_run_closure4.doCall(/home/denis/dev/spring/spring-security/spring-security-spring-security/core/core.gradle:52)
at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:112)
at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:80)
at org.gradle.api.internal.AbstractTask.configure(AbstractTask.java:403)
at org.gradle.api.internal.AbstractTask.configure(AbstractTask.java:58)
at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:104)
at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:61)
at org.gradle.api.internal.DefaultNamedDomainObjectCollection$ContainerElementsDynamicObject.invokeMethod(DefaultNamedDomainObjectCollection.java:299)
at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:93)
at org.gradle.api.internal.project.DefaultProject_Decorated.invokeMethod(Unknown Source)
at org.gradle.groovy.scripts.BasicScript.methodMissing(BasicScript.groovy:72)
at core_7b1r7p4grepm6n5m1341ai6o8k.run(/home/denis/dev/spring/spring-security/spring-security-spring-security/core/core.gradle:49)
at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:52)
... 55 more



 Comments   
Comment by Szczepan Faber [ 16/Jan/12 ]

This looks like a problem in one of the build files of the project, does the project build ok from the command line with the target gradle version you use in the tooling api?

Comment by Denis Zhdanov [ 16/Jan/12 ]

Checked that 'gradle build' for the project produces the same error but it works fine under 'gradlew build' (is configured to use milestone-3).

Comment by Szczepan Faber [ 24/Jan/12 ]

The target gradle version the tooling api uses should be the same as configured in wrapper. The presence of the wrapper pretty much means: "I'm compatible with this particular gradle version. With any other gradle version the build might fail."

The tooling api by default is wrapper-aware. E.g. if you don't configure gradle installation in the GradleConnector, by default we will use the one configured by the wrapper.

I'm inclined to resolve this issue unless there's anything else you find suspicious?

Comment by Denis Zhdanov [ 24/Jan/12 ]

So, am I right understanding that it is considered normal for particular build to be run successfully under the older gradle version and fail under the newer one?

Comment by Szczepan Faber [ 26/Jan/12 ]

Consider following scenarios:

  • The build author uses a feature added in gradle X. So that particular build cannot be built with gradle X-1.
  • The build author uses a feature that regressed in version X+1 and now behaves explosively. So he can only built with Gradle version <=X.

Hope that helps!

Comment by Denis Zhdanov [ 26/Jan/12 ]

Ok, it's clear, thanks.

Comment by Adam Murdoch [ 06/Dec/12 ]

Hi Denis, can we close this issue now?

Comment by Denis Zhdanov [ 06/Dec/12 ]

yes

Comment by Szczepan Faber [ 06/Dec/12 ]

Fixed on JetGradle side, by supporting gradle wrapper.

Generated at Wed Jun 30 12:06:41 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.