This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 230543 - Error creating or opening any grails project
Summary: Error creating or opening any grails project
Status: NEW
Alias: None
Product: updatecenters
Classification: Unclassified
Component: Third-party (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: attila.kelemen
Depends on:
Reported: 2013-05-30 16:58 UTC by RWTerrell
Modified: 2013-06-04 14:59 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:

IDE log (84.56 KB, text/plain)
2013-05-30 16:58 UTC, RWTerrell

Note You need to log in before you can comment on or make changes to this bug.
Description RWTerrell 2013-05-30 16:58:43 UTC
Using grails 1.3.2, with gradle 1.2 installed... any attempt to create or open a grails project gets me the same exception (see below; I've trimmed the stack-trace elements for space, but the full stack trace is in the attached IDE log).

Failed to load Gradle project: grails-1.3.2
org.gradle.tooling.BuildException: Could not fetch model of type 'IdeaProject' using Gradle installation 'C:\Tools\gradle-1.2'.
Caused by: org.gradle.api.internal.LocationAwareException: Build file 'C:\Tools\grails-1.3.2\build.gradle' line: 12
A problem occurred evaluating root project 'grails-1.3.2'.
Caused by: org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'grails-1.3.2'.
Caused by: groovy.lang.MissingPropertyException: No such property: id for class: org.gradle.api.internal.plugins.DefaultObjectConfigurationAction

The error seems to happen on the 'build.gradle' file in the grails directory.  The line causing the problem is:
   apply id: 'groovy'

Product Version = NetBeans IDE 7.3 (Build 201302132200)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.7.0_21
Runtime = Java HotSpot(TM) 64-Bit Server VM 23.21-b01
Comment 1 RWTerrell 2013-05-30 16:58:47 UTC
Created attachment 135154 [details]
IDE log
Comment 2 Martin Janicek 2013-06-04 07:21:48 UTC
This is an exception from Gradle plugin. Reassigning to Third-party component and CCing Attila as the Gradle plugin author.
Comment 3 attila.kelemen 2013-06-04 07:41:25 UTC
As far as I can see from the logs, the build script throws an exception. My guess is that the build script is not compatible with Gradle 1.2. What you can do, is to set "?VER=0.9-20100118091626+0100" in the project properties as "Gradle home". I didn't actually try this but this what is specified fro the wrapper in Grails sources. If this version does not work (due to possible incompatible changes in the Tooling API), you may experiment with other versions (e.g.: "?VER=1.0").
Comment 4 RWTerrell 2013-06-04 14:44:22 UTC
The build script works correctly with Gradle 1.2 when executed from the command line... it only gives an error when I try to open the project through NetBeans (7.3). I've got NetBeans pointing to the same Gradle 1.2 installation.

Here's the output of the 'gradle -version' command executed on the command line:

Gradle 1.2

Gradle build time: Wednesday, September 12, 2012 10:46:02 AM UTC
Groovy: 1.8.6
Ant: Apache Ant(TM) version 1.8.4 compiled on May 22 2012
Ivy: 2.2.0
JVM: 1.6.0_45 (Sun Microsystems Inc. 20.45-b01)
OS: Windows 7 6.1 amd64

Finally, can you clarify your advice to set "?VER=0.9-20100118091626+0100" in the project properties as "Gradle home"? That "Gradle home" option is available in the project properties if I explicitly create a Gradle project in NetBeans, but that's not what I'm doing -- I'm creating a Groovy -> Grails application.
Comment 5 attila.kelemen 2013-06-04 14:59:57 UTC
I assumed that 'C:\Tools\grails-1.3.2' refers to the sources of Grails. If it is a project you have created via a wizard, it means that the wizard generated an out-of-date code (I advise you to use a newer version of Grails). That is, Grails 1.3.2 relies on a pre 1.0 version of Gradle which is not compatible with post 1.0 versions (such as 1.2).

If you don't want to move to a newever version of Grails, you have two options:

- Open the project 'C:\Tools\grails-1.3.2' and right click on the project node, then choose "Properties". There you can set the previously mentioned property.
- Set "Gradle Installation Directory" in the global settings (Tools/Options/Miscellaneous/Gradle) to "?VER=0.9-20100118091626+0100" or to an empty string (if the project has the Gradle wrapper enabled).

I recommend the first option however.