Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ Idea groovy.lang.GroovyRuntimeException: Conflicting module versions

Tags:

My maven builds are fine and able to run groovy from cli. However if I try to run my groovy class inside IntelliJ Idea (version 15 community edition), its gives me below error.

Exception in thread "main" java.lang.ExceptionInInitializerError at org.codehaus.groovy.runtime.InvokerHelper.<clinit>(InvokerHelper.java:61) at groovy.lang.GroovyObjectSupport.<init>(GroovyObjectSupport.java:32) at groovy.lang.Closure.<init>(Closure.java:219) at groovy.lang.Closure.<init>(Closure.java:236) at groovy.lang.Closure$1.<init>(Closure.java:203) at groovy.lang.Closure.<clinit>(Closure.java:203) at filter.App.<clinit>(App.groovy) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:122) Caused by: groovy.lang.GroovyRuntimeException: Conflicting module versions. Module [groovy-all is loaded in version 2.3.9 and you are trying to load version 2.4.5     at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl$DefaultModuleListener.onModule(MetaClassRegistryImpl.java:509)     at org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanExtensionModuleFromProperties(ExtensionModuleScanner.java:77)     at org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanExtensionModuleFromMetaInf(ExtensionModuleScanner.java:71)     at org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanClasspathModules(ExtensionModuleScanner.java:53)     at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:110)     at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:71)     at groovy.lang.GroovySystem.<clinit>(GroovySystem.java:33)     ... 10 more 

Not sure how to get rid of this.

This is my pom dependency.

    <dependency>         <groupId>org.codehaus.groovy</groupId>         <artifactId>groovy-all</artifactId>         <version>2.4.5</version>     </dependency> 

And I am using spring boot.

 <parent>     <groupId>org.springframework.boot</groupId>     <artifactId>spring-boot-starter-parent</artifactId>     <version>1.3.2.RELEASE</version>     <relativePath></relativePath> </parent> 

This is my groovy version installed in system.

Groovy Version: 2.4.5 JVM: 1.8.0_60 Vendor: Oracle Corporation OS: Linux 

Please let me know if someone knows about this.

like image 216
bhai Avatar asked Feb 20 '16 08:02

bhai


1 Answers

you have to delete groovy lib from project settings.

shift+alt+ctrl + s, global libraries - delete groovy. And when trying to run applictaion / test you should have point to groovy from maven dependencies.

like image 159
SuperAndrew Avatar answered Oct 07 '22 18:10

SuperAndrew