ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Reilly" <>
Subject Re: [JPackage-discuss] Fwd: Ant 1.7.0?
Date Thu, 12 Oct 2006 22:47:27 GMT
On 10/11/06, David Walluck <> wrote:
> Hash: SHA1
> Peter Reilly wrote:
> > Ant has done this for a while, the doc does include this info
> > and src/script/ant has been modified to fit into jpackage since
> > I think ant 1.4?.
> Right, rpm_mode has been in there for a while, and I only know of the
> documentation in the comment in the ant script. The new feature being
> added is the OPT_JAR_LIST feature, which seems to only be overrideable
> by setting rpm_mode=false. And as you said, this would imply disabling
> everything, and I don't really like the idea of disabling ANT_HOME just
> to disable OPT_JAR_LIST or vice versa.
> By the way, there is a test -f /usr/bin/build-classpath which should
> probably be test -x /usr/bin/build-classpath in the ant script.
> > I would like to ensure that the doc we do provide is correct
> > and that src/script/ant is good both from a jpackage angle
> > and from a user that wants to install ant. At the moment,
> According to what documentation you sent, it suggested placing jars in
> /usr/share/ant/lib. This would be okay for following the ant way. The
> JPackage way is to place jars in /usr/share/java and then add a file
> into /etc/ant.d. In most cases, /usr/share/ant/lib is empty. This is
> true for packaged applications of course, and for downloaded
> applications, the user may be interested in following the same procedure
> so that it works the same way everything that is packaged does.
> > most people do not know that the ant that is installed
> > in for example fedora core x, is not the same as ant from
> > and are bemused when they install a new version of
> > ant from and find that this new version is ignored
> > by src/script/ant (/etc/ant.conf) overrides it.
> This could be solved by giving the process for changing ANT_HOME (which
> I outlined in a previous email). But again, if you think there's
> something that should be discussed, by all means do. But it seems you
> are not interested in changing the process, rather you want to document
> the current process.

Hi David,
I am interested in understanding the process - to ensure that
whatever is in the doc is correct and that ant does not do anything
silly in the enviroments that it is used in.
At the moment, I do not have proper access to a linux box, (the box
is not connected to the internet), so I have not been able to install
the jpackage ant rpm files (they depend on the java rpm files being
installed), so I could only look at the contents of the rpm files.

I have not looked at how jpackage worked before, so bear with me a
The overview is that (as you say) jar files get placed into
   in ant's case, there are ant.jar, ant-launcher.jar
All the other ant optional jars are placed in
(usually a symbolic link pointing to the versioned file for example
   ant-antlr.jar -> ant-antlr-1.6.5.jar)
for each optional jar an description text file is place in
this file contains the jar file name of the ant task and the jar file name of
implemention jar itself.
so :
   /etc/ant.d/junit consists of junit and ant/ant-junit
corresponding to /usr/share/java/junit.jar and /usr/share/java/ant/ant-junit.jar
which are symbolic links pointing to /usr/share/java/junit-3.8.2.jar and
/usr/share/java/ant/ant-junit-1.6.5.jar (or somthing similar)
The ant script builds up a LOCALCLASSPATH from
and from the contents of all the files in /etc/ant.d)
(Use is made of the script /usr/bin/build-classpath to do this).
$JAVA_HOME/lib{tools.jar,} if they exist are also added to the

finally, java is called on the class org.apache.ant.launch.Launcher
with -classpath $LOCALCLASSPATH

There are a number of points here:

1) if rpmmode is set, ANT_HOME has no bearing on the jars used in
   the java call to start ant, this means that /etc/ant.conf is correct
   to trash the ANT_HOME value (if noconfig is not set).

2) ANT_HOME has also no effect on the standard optional jars, however
    ANT_LIB is set in the ant script file to $ANT_HOME/lib,
    (i.e. /usr/share/ant/lib), so ant.Launcher will also look for jars in that
    directory (which is normally empty).

3) if one sets OPT_JAR_LIST outside the ant script, a lot of ant will stop
    working for exmple regex matching, <style> and the other optional
    tasks (unless one sets OPT_JAR_LIST correctly).

4) If one wants to upgrade ant when in jpackage mode, one should
    use the normal update rpm path (yum update, or apt).

5) If one wants to use the ant distribution from, one
   needs to disable the jpackage ant for that user.

This can be done in a number of ways:
  a) rpm --remove ant
  b)  from the command line: ant --noconfig
  c)  adding a ~/.ant.conf file containing
         export ANT_HOME=xxx; unset rpmmode
  d) my suggestion - if the user has set ANT_HOME, to not
      call /etc/ant.conf
      The reasoning here is that ANT_HOME is simply not usefull
      in a Jpackage env and this is the way we (ant people) normally
      play around with different ant distributions.


> - --
> Sincerely,
> David Walluck
> <>
> Version: GnuPG v1.4.5 (GNU/Linux)
> Comment: Using GnuPG with Mandriva -
> iD8DBQFFLVktN5thZBYlTwkRArYrAJ99FjyegN5hzJvwuMF1s+E115OrcACcC0L7
> bNM2R9UXIAJaFXe6SmGeecs=
> =GzDi
> _______________________________________________
> JPackage-discuss mailing list

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message