You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Øyvind Roth <oy...@barakiroth.net> on 2002/12/03 00:32:52 UTC

no optional.jar in %ANT_HOME%/lib implies regexp doesn't work

Goal:
-----
Remove as many jars as possible from the classpath before calling
%ANT_HOME%\bin\ant.bat

Reasons:
--------
1) The command input line becomes too long (java has a limit of about 2KB).
2) Loosing control over what actual targets through the build process really
need.
3) a) Want the batch startup routines calling ant be as clean and simple as
possible
   b) Want the batch startup routines to call ant from a tabula rasa as far
as possible
   b) Want to do as much as possible within the ant build scripts themselves

Context:
--------
Windows 2000
JDK 1.3.1_02
Ant 1.5.1

Done:
-----
Removed optional.jar from %ANT_HOME%/lib.
Taskdef'ed the tasked needed from optional.jar explicitly.
Put optional.jar in another directory referred to within the taskdef tasks.
All this is done according to FAQ:
http://jakarta.apache.org/ant/faq.html#delegating-classloader

Experiencing:
-------------
JUnit, which for most people is the problem when trying to reach for the
same goal, works fine!!
(Still according to FAQ)
Coming to regular expressions, things won't work (move-mapper-regexp).

Discussion and questions:
-------------------------
When scrutinizing the optional.jar, I see that the regexp wrapping things
(org.apache.tools.ant.util.regexp.*) are packed here. According to my
understanding of the classloader hierarchy this would imply that the same
classloader that has ant.jar in its classpath must also have the
optional.jar in its classpath (as the move task is among the core ones)
1) Have I understoood correctly?
2) Which again implies that the saltos made to remove optional.jar and
taskdef'ing JUnit are invane as the optional.jar must be put back in place?
3) The problem is unsolvable?
4) The problem could be solved by removing from optional.jar the
org.apache.tools.ant.util.regexp.* classes and put them in my_optional.jar
and put my_optional.jar in the initial classpath? (I haven't tried out this
one, as this is not a way I want to work with thirdparty tools)
5) Is there an elegant solution?

On beforehand,
 thanks to you experts out there...


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>