Error:Cannot compile Groovy files: no Groovy libra

2019-02-06 19:20发布

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.

2条回答
狗以群分
2楼-- · 2019-02-06 19:35

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.

查看更多
Bombasti
3楼-- · 2019-02-06 19:40

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

groovy support

查看更多
登录 后发表回答