Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellij IDEA 14 Errors with grails run-app

I upgraded to IDEA 14 (from 13) and when I attempt to run my grails 2.2.0 application, I am getting the following error:

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/gdboling/Projects/GenRocket/web/build.gradle' line: 92

* What went wrong:
A problem occurred evaluating root project 'web'.
> No such property: environment for class: org.gradle.api.internal.project.DefaultProject_Decorated

It would seem that IDEA is attempting to use my build.gradle as part of the grails build process. IDEA 13 didn't do this. I use the build.gradle for some other non-grails related tasks for the project.

If I remove the build.gradle file all together, I get this error:

FAILURE: Build failed with an exception.

* What went wrong:
Task 'grails-run-app' not found in root project 'web'.

* Try:
Run gradle tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

I do see the Grails View in the IDE but when I try and do a Make, it is telling me to re-import the gradle project. So it would seem that IntelliJ think this is a gradle project. How I can tell it that is is just a grails project?

To confirm my suspicions, I've opened a grails project that did not contain a build.gradle and it works just fine.

like image 630
Gregg Avatar asked Nov 16 '14 22:11

Gregg


Video Answer


1 Answers

I had faced similar issue when unknowingly kept on hit next next in hurry. So, you probably mistakenly created a gradle project as shown in screenshot. And when you recreated the project created it as "Create project from existing source" which idea well knows as grails-app (default for idea).

See if you can reproduce the error by re-importing the project using import project form external module. Probable Mistake done

like image 80
Vinay Prajapati Avatar answered Oct 11 '22 13:10

Vinay Prajapati