You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Gavin <ga...@16degrees.com.au> on 2009/04/09 11:46:21 UTC

Optional Jars

Hi All,

Apologies for the long post, I do have a few things to ask. In return for a
cure I'll try and put something back in by maybe clarifying some docs or
adding examples if either of those ends up being warranted. On top of that,
Buildbot at Apache may be able to offer something such as snapshots etc
(teamcity.jetbrains seems to no longer be available so your builds are not
available)

Here comes another one of those classpath jar type scenarios. Having
searched the archived this really does seem to be the most asked question.

First off, I've read all the kinds of advice given on where to put these
jars etc, and to not set an actual classpath. No matter what I do or where I
put things, it seems to make no difference. So I must be doing something
wrong. I've also read a little bit that by putting certain jars in place it
can make other things 'not' work, I'm certainly confused by that and could
be the cause of some of my troubles.

The main advice I've taken on board is this quote by Jan 

"... Ant doesnt require a CLASSPATH and you shouldnt have one set.
The ant.* launch script starts the ant-launcher.jar. This one collects all
JARs in \
/lib and /lib/optional and all JARs given with -lib option ..."

So hopefully I've followed that.

The main aim here is to build various Apache projects using Buildbot. The
main url is http://ci.apache.org - that's the official place. I am currently
testing many more projects at http://202.60.90.243:8020/waterfall before
moving them over so I'll point out some errors I'm getting from that.

Here is my current setup.

-------------------------------------------
 ANT PROPERTIES
-------------------------------------------
ant.version: Apache Ant version 1.7.0 compiled on August 29 2007
ant.java.version: 1.6
ant.core.lib: /usr/share/ant/lib/ant.jar
ant.home: /usr/share/ant

-------------------------------------------
 ANT_HOME/lib jar listing
-------------------------------------------
ant.home: /usr/share/ant
ant-launcher.jar (11814 bytes)
ant-bootstrap.jar (16489 bytes)
bcel.jar (528673 bytes)
ant-junit.jar (92792 bytes)
ant-antlr.jar (5769 bytes)
jakarta-oro-2.0.8.jar (65261 bytes)
ant.jar (1327716 bytes)
junit.jar (70424 bytes)

Here is the first project that fails :-

Apache JMeter
-------------

(Details of failed build at
http://202.60.90.243:8020/builders/jmeter-trunk/builds/9/steps/shell/logs/st
dio)

The helpful error message I get is :-

Cause: the class org.apache.tools.ant.taskdefs.optional.ReplaceRegExp was
not found.
        This looks like one of Ant's optional components.
Action: Check that the appropriate optional JAR exists in
        -/usr/share/ant/lib
        -/home/buildslave1/.ant/lib
        -a directory added on the command line with the -lib argument

Now, I have put the jars in ANT_HOME/lib, also tried $USER_HOME/.ant/lib and
also even tried specifying those two locations (one at a time) with the -lib
argument.

>From what I understand of the docs, ReplaceRegExp requires the Jakarta-oro.*
jar ? but I could be wrong on that.

Another project that fails :-

Apache pdfbox
-------------

(Details of failed build at
http://202.60.90.243:8020/builders/pdfbox-trunk/builds/0/steps/compile/logs/
stdio)

Error Message :-

Cause: the class org.apache.tools.ant.taskdefs.optional.PropertyFile was not
found.
        This looks like one of Ant's optional components.

I could not find which optional jar would be needed for that.

Ok, I think those two examples will do for now, and no doubt point out my
mistake.

Back to these 'optional jars' - is there a place where all of these optional
jars live, so folks can get them all from one place without having to scour
the earth for them. For instance if you want a perl module, cpan is the
place to go, is there a similar place for all ants extra goodies? If not
could we benefit from having such a place ?

Onto buildbot. If we can get all the above working great and I end up
understanding what I'm doing, could Ant project benefit from having build
tests and snapshot builds etc run on Buildbot at Apache? (I know you use
Hudson for Ivy so I'm not suggesting a replacement for that).

Anyway, thanks for listening, assuming you got this far - well done!

Gav...



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Optional Jars

Posted by Stefan Bodewig <bo...@apache.org>.
On 2009-04-09, Gavin <ga...@16degrees.com.au> wrote:

> Great, thanks. My main problem stemmed from the fact I did an 'apt-get
> install ant' on the Ubuntu machines, thinking it would be a complete
> installation. In fact doing it this way and I did not get *any* jars
> whatsoever (in /usr/share/ant/lib), those you saw in my output above were a
> result of me finding and adding them manually. Also you don't get the docs
> or other directories.

No idea who has created the Ubuntu packages for Ant, they never asked
the Ant community for advice.  In general the Ant developers recommend
to use the official Ant distributions instead of whatever is part of
the Linux package siyste, of your choice.

Some distributions are also known for modifying the Ant bash wrapper
script leading to problems that are hard to track down for us.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: Optional Jars

Posted by Gavin <ga...@16degrees.com.au>.

> -----Original Message-----
> From: Stefan Bodewig [mailto:bodewig@apache.org]
> Sent: Thursday, 9 April 2009 8:32 PM
> To: user@ant.apache.org
> Subject: Re: Optional Jars
> 
> On 2009-04-09, Gavin <ga...@16degrees.com.au> wrote:
> 
> >  ANT_HOME/lib jar listing
> > -------------------------------------------
> > ant.home: /usr/share/ant
> > ant-launcher.jar (11814 bytes)
> > ant-bootstrap.jar (16489 bytes)
> > bcel.jar (528673 bytes)
> > ant-junit.jar (92792 bytes)
> > ant-antlr.jar (5769 bytes)
> > jakarta-oro-2.0.8.jar (65261 bytes)
> > ant.jar (1327716 bytes)
> > junit.jar (70424 bytes)
> 
> This is pretty incomplete, a lot of the Ant's own jars are missing.

aha, a side effect of relying on apt-get, see below ...

> 
> > Here is the first project that fails :-
> 
> > Apache JMeter
> > -------------
> 
> > (Details of failed build at
> > http://202.60.90.243:8020/builders/jmeter-
> trunk/builds/9/steps/shell/logs/st
> > dio)
> 
> > The helpful error message I get is :-
> 
> > Cause: the class org.apache.tools.ant.taskdefs.optional.ReplaceRegExp
> was
> > not found.
> 
> requires either ant-nodeps.jar for using JDK 1.4+ regexp or
> ant-apache-oro.jar (given that you have ORO in ANT_HOME/lib).
> 
> > Cause: the class org.apache.tools.ant.taskdefs.optional.PropertyFile was
> not
> > found.
> >         This looks like one of Ant's optional components.
> 
> this is in ant-nodeps.jar which you don't have.
> 
> > Back to these 'optional jars' - is there a place where all of these
> optional
> > jars live, so folks can get them all from one place without having to
> scour
> > the earth for them.
> 
> The Ant distribution only contains Ant's own classes, they are not the
> dependencies required.  You may have thought ant-apache-oro.jar and
> jakarta-oro-2.0.8.jar were the same, but they aren't.
> ant-apache-oro.jar contains the classes that require ORO, you need
> both of them in ANT_HOME/lib to make things work.

Great, thanks. My main problem stemmed from the fact I did an 'apt-get
install ant' on the Ubuntu machines, thinking it would be a complete
installation. In fact doing it this way and I did not get *any* jars
whatsoever (in /usr/share/ant/lib), those you saw in my output above were a
result of me finding and adding them manually. Also you don't get the docs
or other directories.

I downloaded the source and extracted the libs from dist/libs/ and all is
now working fine. A step the perhaps apt-get should be told to do in the
future?

> 
> There is a build file called fetch.xml in Ant's svn repo[1] (it is
> also part of the source distribution, it could even be part of the
> binary dist, not sure) that will use the Maven Ant tasks to collect
> all available optional dependencies.

Good to know, as I had to download the source distro to get that, the
required jars were in dist/libs anyway so seemed easier to just copy them
over.

> 
> Ant does have some optional dependencies on proprietary third party
> jars that cannot be provided at all.  I wouldn't expect any of the
> projects you build in buildbot to make use of the related tasks,
> though.

So far so good, after installing the jars the above two projects are now
passing fine - along with another 3 so that's great, thanks for your help!

> 
> > If we can get all the above working great and I end up understanding
> > what I'm doing, could Ant project benefit from having build tests
> > and snapshot builds etc run on Buildbot at Apache?
> 
> I think so.  We used to have nightly builds on vmbuild, but I don't
> think they are available anymore.

Ok, I'll take a look at doing that these next couple of days.

Cheers

Gav...


> 
> Many thanks
> 
>      Stefan
> 
> [1] http://svn.apache.org/repos/asf/ant/core/trunk/fetch.xml
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> 
> --
> No virus found in this incoming message.
> Checked by AVG.
> Version: 7.5.557 / Virus Database: 270.11.47/2047 - Release Date: 4/8/2009
> 5:53 AM


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Optional Jars

Posted by Stefan Bodewig <bo...@apache.org>.
On 2009-04-09, Gavin <ga...@16degrees.com.au> wrote:

>  ANT_HOME/lib jar listing
> -------------------------------------------
> ant.home: /usr/share/ant
> ant-launcher.jar (11814 bytes)
> ant-bootstrap.jar (16489 bytes)
> bcel.jar (528673 bytes)
> ant-junit.jar (92792 bytes)
> ant-antlr.jar (5769 bytes)
> jakarta-oro-2.0.8.jar (65261 bytes)
> ant.jar (1327716 bytes)
> junit.jar (70424 bytes)

This is pretty incomplete, a lot of the Ant's own jars are missing.

> Here is the first project that fails :-

> Apache JMeter
> -------------

> (Details of failed build at
> http://202.60.90.243:8020/builders/jmeter-trunk/builds/9/steps/shell/logs/st
> dio)

> The helpful error message I get is :-

> Cause: the class org.apache.tools.ant.taskdefs.optional.ReplaceRegExp was
> not found.

requires either ant-nodeps.jar for using JDK 1.4+ regexp or
ant-apache-oro.jar (given that you have ORO in ANT_HOME/lib).

> Cause: the class org.apache.tools.ant.taskdefs.optional.PropertyFile was not
> found.
>         This looks like one of Ant's optional components.

this is in ant-nodeps.jar which you don't have.

> Back to these 'optional jars' - is there a place where all of these optional
> jars live, so folks can get them all from one place without having to scour
> the earth for them.

The Ant distribution only contains Ant's own classes, they are not the
dependencies required.  You may have thought ant-apache-oro.jar and
jakarta-oro-2.0.8.jar were the same, but they aren't.
ant-apache-oro.jar contains the classes that require ORO, you need
both of them in ANT_HOME/lib to make things work.

There is a build file called fetch.xml in Ant's svn repo[1] (it is
also part of the source distribution, it could even be part of the
binary dist, not sure) that will use the Maven Ant tasks to collect
all available optional dependencies.

Ant does have some optional dependencies on proprietary third party
jars that cannot be provided at all.  I wouldn't expect any of the
projects you build in buildbot to make use of the related tasks,
though.

> If we can get all the above working great and I end up understanding
> what I'm doing, could Ant project benefit from having build tests
> and snapshot builds etc run on Buildbot at Apache?

I think so.  We used to have nightly builds on vmbuild, but I don't
think they are available anymore.

Many thanks

     Stefan

[1] http://svn.apache.org/repos/asf/ant/core/trunk/fetch.xml

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org