Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error:Cannot compile Groovy files: no Groovy library is defined for module "myprojectname"

enter image description hereI have cloned the project from github and then imported it to inetllij 2017.1. and also added all dependency modules. Basically, we are trying to upgrade our project using latest jars.

When I try to build I get the above error along with 933 errors, jdk 1.7,grails 2.5 and tomcat 8 is used. Run configuration is also throwing error as Run Configuration: cannot execute Note : previous version of my project works perfectly fine with all same settings Please help.

like image 789
deepti mullur Avatar asked Apr 17 '17 11:04

deepti mullur


3 Answers

Right click on the problematic module and add Groovy support to it:

groovy support

like image 114
CrazyCoder Avatar answered Oct 19 '22 21:10

CrazyCoder


In my case it was a Spec placed in the src/main/java instead of the src/test/groovy. Unfortunately InteliJ doesn't present the error in that class but instead doesn't compile the whole module.

To find out which class is wrong just open the not compiled module settings ( F4 on it in Project tree) -> Dependencies (Tab) -> Groovy -> change from Test to Compile.

What makes the problem even worse is that maven compiled everything without problems.

like image 8
pawelccb Avatar answered Oct 19 '22 21:10

pawelccb


Steps to follow:

  • Go to File -> Project Structure
  • From modules add the framework support (click on the + icon) for Groovy i.e. where you have the Groovy SDK on your system:

enter image description here

like image 4
Saikat Avatar answered Oct 19 '22 20:10

Saikat