Configuring groovy SDK within Intellij: have to repeat this each time project is built?
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>
Related videos on Youtube
java123999
Updated on September 16, 2022Comments
-
java123999 over 1 year
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 libraryorg.codehaus.groovy:groovy-all:2.4.4
, this then adds this library as adependency
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?
-
MarkHu about 7 yearsCan you paste an example?
-
Sean about 7 years@MarkHu I've edited it for you. In the future, you can go to search.maven.org and look for the dependency (in this case "groovy-all"). Click on the version you want, and there will be a small xml snippet on the left-hand side that you can copy-paste (search.maven.org/…)