Monday, March 23, 2009

Groovy Grape: Problem resolving xalan

There is a problem in Groovy Grape: It fails resolving xalan 2.7.1.

The following grape declaration for instance leads to the error:
@Grab(group='net.sourceforge.htmlunit', module='htmlunit', version='[2.4,)')

The reason is, that htmlunit has a dependency to xalan, and xalan cannot be resolved...

The problem can also be reproduced on the commandline: grape resolve xalan xalan 2.7.1
The following error is printed on the console:

[FAILED ] xalan#xalan;2.7.1!xalan.jar: invalid sha1: expected=sha1(xalan-2.7.1.jar)= computed=75f1d83ce27bab5f29fff034fc74aa9f7266f22a (9927ms)

The underlying reason is the follwing bug in Ivy 2.0: IVY-1006.

The bug is supposed to be fixed in Ivy 2.1, but Groovy 1.6 bundles Ivy 2.0.

Meanwile a workaround is to manually download serializer-2.7.1.jar and xalan-2.7.1.jar from the maven repository and copy it at the place where grape would put it: ~/.groovy/grapes/xalan/serializer/jars/ respective ~/.groovy/grapes/xalan/xalan/jars/ on OS X.

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...