Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configuring groovy SDK within Intellij: have to repeat this each time project is built?

I was getting an error when trying to compile my application within Intellij:

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

I solved this issue by selecting "Configure Groovy SDK" for the module, when prompted by Inteli. I used library org.codehaus.groovy:groovy-all:2.4.4 , this then adds this library as a dependency for the module.

The issue is that each time I re-build my project or "refresh gradle projects" in Intellij I have to "Configure Groovy SDK" again.

How can I set up my project so that I don't have to re-do this step each time?

like image 499
java123999 Avatar asked Nov 25 '15 15:11

java123999


1 Answers

add groovy-all as a dependency to in your pom.xml (if you're using maven) or your build.gradle (for gradle). Otherwise every time your refresh or sync, intellij will remove the "extra" dependency it finds.

<dependency>
    <groupId>org.codehaus.groovy</groupId>
    <artifactId>groovy-all</artifactId>
    <version>2.4.6</version>
</dependency>
like image 142
Sean Avatar answered Sep 20 '22 19:09

Sean