ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From RAPPAZ Francois <>
Subject RE: Ant and jar creation
Date Fri, 10 Nov 2017 08:10:32 GMT
Thanks for the hint

I saw that there is an ejbjar tasks that use the BCEL parser

could I use this to build "normal" jar file ?

BCEL seems to be what's is needed to have the job done in ant. 
There is a example that list the dependencies starting from the class given
in argument. I could still take this to have a list that I could use with a normal jar ant

Strange that BCEL is not use with the jar task in ant ...

-----Original Message-----
From: Dominique Devienne [] 
Sent: 09 November 2017 16:11
To: Ant Users List <>
Subject: Re: Ant and jar creation

On Thu, Nov 9, 2017 at 2:30 PM, RAPPAZ Francois <>

> I'm returning to some java projects that I left for some years. These 
> projects use ant to compile, make  the doc and specially they use the 
> external task genjar to build jar files.
> I spend some hours trying to have genjar working (I downloaded the 
> source from sourceforge) and it's seems that the part of the code that 
> try to read the class file does not work anymore. It's seems I'm 
> hitting the end of the file when that was not expected.
> The most recent version of genjar is  1.0.2 and is more the ten years old.
> Does anyone know of a substitute ? I can use the jar task from ant, 
> once I have a list of classes, but to build elegantly a jar without a 
> list, genjar was great.
> Thanks for any suggestion !

Sounds like that very old GenJar custom task was never updated for newer JDKs and new .class
file formats?

The <depend> task almost does what you want I think, but doesn't expose a Selector unfortunately.
But it looks like it has the code to do what you want, with an external dependency to a .class
file parser probably though.
(even GenJar had plans to use BCEL for that, but that probably never materialized).

Once you have that depend-based selector, you can use <jar> almost like you did <genjar>

FWIW. Good luck, --DD

View raw message