I'm using Groovy from XWiki and the following code used to work with earlier
versions of Groovy/Ivy (not sure which one is the culprit ;)):
{{groovy}}
@Grab(group='org.codehaus.groovy.modules.http-builder',
module='http-builder', version='0.5.1')
import groovyx.net.http.RESTClient
github = new RESTClient( 'http://github.com/api/v2/json/' )
...
{{/groovy}}
I'm now using Groovy 1.8.1/Ivy 2.2.0 and I now get the following error:
Caused by: javax.script.ScriptException:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup
failed:
General error during conversion: Error grabbing Grapes -- [download failed:
commons-beanutils#commons-beanutils;1.8.0!commons-beanutils.jar]
java.lang.RuntimeException: Error grabbing Grapes -- [download failed:
commons-beanutils#commons-beanutils;1.8.0!commons-beanutils.jar]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at
org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
at
org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:71)
at
org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrap.callConstructor(ConstructorSite.java:81)
at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:54)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:190)
at groovy.grape.GrapeIvy.getDependencies(GrapeIvy.groovy:336)
I have found a workaround below but I'd like to remove it since it's...
well.. a workaround:
{{groovy}}
@Grab(group='org.codehaus.groovy.modules.http-builder',
module='http-builder', version='0.5.1')
@GrabExclude('commons-beanutils:commons-beanutils')
...
{{/groovy}}
Any idea or thing I should try? (I've already tried using a custom grapes
config file but that did not help).
Thanks a lot
-Vincent Massol
XWiki developer
-----
-Vincent Massol
XWiki developer
--
View this message in context: http://groovy.329449.n5.nabble.com/Issue-with-Grapes-and-commons-beanutils-tp4753704p4753704.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
> grape -debug install org.codehaus.groovy.modules.http-builder http-builder 0.5.1
Cheers, Paul.
Thanks for the help. I was actually able to find the issue with the debug
command.
Here's what I think happened:
* I had ivy information about commons-beanutils 1.8.0 in my .groovy
directory
* In my local m2 repository (.m2/repository) I had a directory for
commons-beanutils 1.8.0. However, for some reason unknown to me, it only had
a pom file (and its sha1):
vmassol@vincent-massols-macbook-pro ~/Desktop/groovy-1.8.1/bin $ ls
/Users/vmassol/.m2/repository/commons-beanutils/commons-beanutils/1.8.0/
_maven.repositories commons-beanutils-1.8.0.pom
commons-beanutils-1.8.0.pom.sha1
So I think this was making Grapes/Ivy not try to download it again...
I've now deleted both my .groovy and
/Users/vmassol/.m2/repository/commons-beanutils/commons-beanutils/1.8.0/ and
it started working again, downloading it from central.
I have 2 suggestions for improvements though (apart from trying to download
it if not found locally...):
- I've noticed that you check for artifacts on codehaus.repository.org
**before** checking central. I think central should be checked first, that
should speed up most resolutions.
- I've also noticed that by default you check java.net maven repository and
it's not resolving fine right now. I'd suggest to exclude it from the
default grapes config (especially since java.net is supposed to be synced to
central now or anytime soon).
Thanks for you help again
-Vincent
-----
-Vincent Massol
XWiki developer
--
View this message in context: http://groovy.329449.n5.nabble.com/Issue-with-Grapes-and-commons-beanutils-tp4753704p4753878.html
Cheers, Paul.