Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » jardesc to ant
jardesc to ant [message #832066] Thu, 29 March 2012 18:22 Go to next message
Bruce L. is currently offline Bruce L.Friend
Messages: 81
Registered: June 2011
Member
Hi,

the export-to-runnable-jar option for a Java project allows you to generate an equivalent ant script, so that you can automatically export the same jar using ant.

Why there is no such an option when exporting a regular jar????
The .jardesc is useful but it requires manual steps to actually export the jar.
I would like to have an ant script also for the non-runnable jars, so that I can export everything, say, from the command line

thanks
B
Re: jardesc to ant [message #832354 is a reply to message #832066] Fri, 30 March 2012 03:41 Go to previous messageGo to next message
Bob Sadarka is currently offline Bob SadarkaFriend
Messages: 40
Registered: February 2012
Member
So why not creating an Ant script with jar target to generate jar file, then add the script to Eclipse Build order?
Re: jardesc to ant [message #832554 is a reply to message #832354] Fri, 30 March 2012 09:22 Go to previous messageGo to next message
Bruce L. is currently offline Bruce L.Friend
Messages: 81
Registered: June 2011
Member
Because I do not know ant and thus I would have preferred to have Eclipse generate the script for me.. Also because then I would be sure the script is correct, ie it includes whatever has to be included in the jar.

I asked just because the generation of the ant script is available when you export a runnable jar, but not for a plain jar, which does not make so much sense to me.

Anyway, if this feature is not available I guess I will have to develop the ant script myself

thanks
B
Re: jardesc to ant [message #832707 is a reply to message #832554] Fri, 30 March 2012 13:38 Go to previous messageGo to next message
David Wegener is currently offline David WegenerFriend
Messages: 1445
Registered: July 2009
Senior Member
Why can't you use the script that is created when you export an executable jar? This seems to be what you want. An executable jar is a jar.
Re: jardesc to ant [message #832753 is a reply to message #832707] Fri, 30 March 2012 14:41 Go to previous messageGo to next message
Bruce L. is currently offline Bruce L.Friend
Messages: 81
Registered: June 2011
Member
I think an executable jar is a jar that contain a class with the main() definition, and you can invoke it with java -jar <your jar>. For this reason I think the executable jar contains additional stuff, like a manifest file that specifies the class path, or amenities like that.

A jar file does not need to be executable nor need to contain a class with main. It is just a library, ie a collection of classes.
If they were the same thing, Eclipse probably would not have two different export options, right?

B
Re: jardesc to ant [message #832844 is a reply to message #832753] Fri, 30 March 2012 17:03 Go to previous messageGo to next message
David Wegener is currently offline David WegenerFriend
Messages: 1445
Registered: July 2009
Senior Member
All jars have a manifest in them. They don't necessarily have a main class defined. Having the main class doesn't prevent you from using the jar as a "library". If you really don't want the main class or classpath entries added to the jar, edit the ant script and remove these attribute entries after you generate the script.
Re: jardesc to ant [message #1003364 is a reply to message #832844] Mon, 21 January 2013 03:30 Go to previous messageGo to next message
Oliver Coleman is currently offline Oliver ColemanFriend
Messages: 2
Registered: October 2012
Junior Member
Well, I've come across a reason to want the "export as ant script" option for the regular jar export feature: the regular jar export has a lot more features, such as including arbitrary folders, etc. I don't know ant and would like to avoid having to learn it as much as possible (we all want to focus on what the software is actually for, of course...). The reason I want to use ant is because there are some things I want to do that the jar export won't do, such as incrementing a build number. This looks easy enough to add to an existing ant script, I just don't want to spend the time writing an ant script (almost) from scratch.
Re: jardesc to ant [message #1036556 is a reply to message #832066] Mon, 08 April 2013 14:36 Go to previous message
Ron A is currently offline Ron AFriend
Messages: 12
Registered: December 2010
Junior Member
Just tossing my $0.02 in .... I agree completely with this request. Eclipse will create ant scripts for most things ... why not for creating a non-executable jar? It would really help me out.
Previous Topic:Enabling navigation history for inter tab navigation
Next Topic:Need to add Weblogic plugin to Eclipse Juno
Goto Forum:
  


Current Time: Thu Mar 28 21:02:42 GMT 2024

Powered by FUDForum. Page generated in 0.03214 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top