RC-Paves3-build / plovr

Automatically exported from code.google.com/p/plovr
0 stars 0 forks source link

includes ant in jar #24

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The distributed jar file plovr-0751912cc154.jar includes a copy of Ant, which 
messes up projects that use a different Ant and add the plovr jar file to the 
classpath.

Somehow this does not happen when I build plovr from sources - the resulting 
jar does not contain the Ant classes.

With the distributed jar, my Grails build fails with:

jar:file:/home/marcus/grails-plugins/grails-closure/lib/plovr-0751912cc154.jar!/
org/apache/tools/ant/antlib.xml:37: Problem: failed to create task or type 
componentdef
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.

        at org.apache.tools.ant.UnknownElement.getNotFoundException(UnknownElement.java:484)
        at org.apache.tools.ant.UnknownElement.makeObject(UnknownElement.java:416)
        at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:160)
        at org.apache.tools.ant.taskdefs.Antlib.execute(Antlib.java:146)
        at org.apache.tools.ant.taskdefs.Definer.loadAntlib(Definer.java:432)
        at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:281)
        at org.apache.tools.ant.ComponentHelper.checkNamespace(ComponentHelper.java:790)
        at org.apache.tools.ant.ComponentHelper.getDefinition(ComponentHelper.java:260)
        at org.apache.tools.ant.ComponentHelper.createComponent(ComponentHelper.java:237)
        at org.apache.tools.ant.ComponentHelper.createComponent(ComponentHelper.java:216)
        at org.apache.tools.ant.UnknownElement.makeObject(UnknownElement.java:414)
        at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:160)

Original issue reported on code.google.com by mar...@better.se on 6 Dec 2010 at 8:39

GoogleCodeExporter commented 9 years ago
Incidentally some of the libraries that plovr bundles in its jar cause some 
conflicts for us, for example if we already have the Google collections in the 
classpath. Maybe the dependencies could be jarjar'ed. Or better yet, also ship 
a slim jar without the dependencies (or even enable use with Maven, now that 
Closure Compiler is mavenized).

Original comment by mar...@better.se on 22 Dec 2010 at 2:19

GoogleCodeExporter commented 9 years ago
I went a very different way with respect to managing the Closure dependencies 
as explained here:

http://code.google.com/p/plovr/wiki/MaintainingMirrorsOfClosureCodeInHg

This resulted in modifying build.xml significantly:

http://code.google.com/p/plovr/source/detail?r=5f466701a04b9b7027e9368886d9ebbf3
0561367

which fixes the issue where the Ant jar was being included inside plovr.jar.

With the new code layout, you should easily be able to create an even more 
slimmed-down version of plovr.jar. If you can come up with a compelling, 
generally useful Ant target to build such a slimmed-down version, then I will 
include it in plovr's build.xml, but I expect that most users will still find 
it easier to use the all-in-one jar.

Original comment by bolinf...@gmail.com on 2 Jan 2011 at 10:16