Ant isn't in the very best shape for being embedded, it assumes it has
been invoked via the command line in various places.

One of the things that have changed between Ant 1.5.x and 1.6.0 is
that <ant> and friends now check whether they are part of a circular
invocation by comparing the current build file location with the one
of the file they are supposed to call.  This new code assumed that
ant.file has been set.

Actually, in the context of Jelly the value doesn't matter at all, so
you could set it to something arbitrary.  I've chosen to use the
String form of JellyContext#getCurrentURL in my patch, but you may
want to use something different.

A patch like the appended patch is necessary to make Jelly work with
Ant 1.6.0 and 1.6.1 - Ant 1.6.2 (no release scheduled yet) will work
with Jelly as it is.

Stefan

Index: src/java/org/apache/commons/jelly/tags/ant/AntTagLibrary.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-commons/jelly/jelly-tags/ant/src/java/org/apache/commons/jelly/tags/ant/AntTagLibrary.java,v
retrieving revision 1.29
diff -u -r1.29 AntTagLibrary.java
--- src/java/org/apache/commons/jelly/tags/ant/AntTagLibrary.java       25 Feb 2004 
01:23:59 -0000      1.29
+++ src/java/org/apache/commons/jelly/tags/ant/AntTagLibrary.java       14 Apr 2004 
14:49:10 -0000
@@ -134,6 +134,8 @@
         
         project.init();
         project.getBaseDir();
+        project.setProperty("ant.file", 
+                            context.getCurrentURL().toExternalForm());
 
         return project;
     }

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to