I have a maven project and a groovy script associated with one. Script is self-sufficient and it runs successfully from command promt (groovy script.groovy). But when I run script from IDEA I get different errors. As I understand reasons of errors are maven dependencies.
1. If maven project has a dependency on groovy, groovy starts running from maven's repository (groovy.jar and groovy.home located in /.m2/...). Resolved it this way: right click on project ,“Add Framework support” and add Groovy from “real” groovy.home (not from maven).
2. But then a met the error I can't resolve:
java.lang.LinkageError: loader constraint violation: loader (instance of groovy/lang/GroovyClassLoader) previously initiated loading for a different type with name "javax/management/MBeanServer"
I think IDEA loads all dependencies from pom file even they are not using in groovy.
I could not find any instructions how to create groovy scripts in the maven projects. Is there any way to run groovy script in IDEA without influence of maven? Or may be some advice how to configure groovy/project to avoid linkage error?