[groovy-user] @Grab and Groovy-all version mismatch

101 views
Skip to first unread message

lprimak

unread,
May 5, 2014, 2:37:20 PM5/5/14
to us...@groovy.codehaus.org
I have an application that executes Groovy scripts via GroovyShell

When I try to use @Grap in those scripts, the @Grab 'd module's dependencies
sometimes conflict with the core Groovy, and refuse to load.
groovy-all is 2.2.2 which is built into the application,
but gpars, etc. require groovy-all 2.1.9

Is there any way to fix or get around these issues?
Issues are the same for Graila, gpars, etc.

Thanks

Here is the exception:
----------------------
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup
failed:
General error during conversion: Conflicting module versions. Module
[groovy-all is loaded in version 2.2.2 and you are trying to load version
2.1.9

groovy.lang.GroovyRuntimeException: Conflicting module versions. Module
[groovy-all is loaded in version 2.2.2 and you are trying to load version
2.1.9
at
org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl$DefaultModuleListener.onModule(MetaClassRegistryImpl.java:509)
at
org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanExtensionModuleFromProperties(ExtensionModuleScanner.java:78)
at
org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.registerExtensionModuleFromProperties(MetaClassRegistryImpl.java:152)
at
org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl$registerExtensionModuleFromProperties.call(Unknown
Source)
at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
at groovy.grape.GrapeIvy.processCategoryMethods(GrapeIvy.groovy:287)
at
groovy.grape.GrapeIvy.this$2$processCategoryMethods(GrapeIvy.groovy)
at
groovy.grape.GrapeIvy$this$2$processCategoryMethods$7.callCurrent(Unknown
Source)
at groovy.grape.GrapeIvy.grab(GrapeIvy.groovy:258)
at groovy.grape.Grape.grab(Grape.java:163)
at
groovy.grape.GrabAnnotationTransformation.visit(GrabAnnotationTransformation.java:328)
at
org.codehaus.groovy.transform.ASTTransformationVisitor$3.call(ASTTransformationVisitor.java:319)
at
org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:912)
at
org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:574)
at
org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:550)
at
org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:527)
at
groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:279)
at
groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:258)
at groovy.lang.GroovyShell.parseClass(GroovyShell.java:613)
at groovy.lang.GroovyShell.parse(GroovyShell.java:625)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:516)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:556)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:527)
….



--
View this message in context: http://groovy.329449.n5.nabble.com/Grab-and-Groovy-all-version-mismatch-tp5719509.html
Sent from the groovy - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Schalk Cronj é

unread,
May 5, 2014, 3:17:56 PM5/5/14
to us...@groovy.codehaus.org
Not sure if it would help, but try to add
@GrabExclude('org.codehaus.groovy:groovy-all:2.1.9') in the scripts
being called.
--
Schalk W. Cronjé
@ysb33r

lprimak

unread,
May 5, 2014, 3:55:25 PM5/5/14
to us...@groovy.codehaus.org
Thank you,

I added @GrabExclude('org.codehaus.groovy:groovy-all')
and it fixed the problems.



--
View this message in context: http://groovy.329449.n5.nabble.com/Grab-and-Groovy-all-version-mismatch-tp5719509p5719512.html

Lenny Primak

unread,
May 5, 2014, 1:14:36 PM5/5/14
to us...@groovy.codehaus.org

Paul King

unread,
May 9, 2014, 5:23:58 PM5/9/14
to us...@groovy.codehaus.org

No version is used with GrabExclude, so something like this is what should work:

@GrabExclude('org.codehaus.groovy:groovy-all')

Cheers, Paul.
---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com
Reply all
Reply to author
Forward
0 new messages