Bug 172202 - Build the jar for a Java Project in headless eclipse
Summary: Build the jar for a Java Project in headless eclipse
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0.2   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-30 13:40 EST by Dorian Birsan CLA
Modified: 2007-02-02 12:20 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dorian Birsan CLA 2007-01-30 13:40:10 EST
I couldn't find a way to build the jar for a Java Project from a headless eclipse.
The current JDT API's sit in the jdt.ui plugin, which will not work in a headless eclipse. For example, when creating a JarPackagedData, the jdt ui plugin class is loaded and will trigger loading of the Workbench, which in turn throw an exception.

Are there other ways to build the jar corresponding to a Java project?
If not, is it possible to have this available on the eclipse 3.2 stream? thanks!
Comment 1 Alex Blewitt CLA 2007-01-30 19:20:34 EST
I'm not sure that this is critical... but in any case, I suspect you meant to choose 3.2 from the version list and not 3.0.2 -- there's zero chance of anything being changed as old as 3.0 :-)

The headless build for JDT plugins works OK, and given that a plugin is a superset of a Java build, I'm surprised that it can't be made to work. However, the plugins build results in the generation of an Ant file, which is then executed, which in turn then uses Ant's javac adapter to call back into Eclipse's compile APIs. Would something like that be useful?

Alex.
Comment 2 Olivier Thomann CLA 2007-02-02 11:11:33 EST
Could you please describe what you mean by "build the jar for a Java Project" ?
If you mean the equivalent of the Export wizard for a java project at the core level, this would be a new feature.
Regarding a fix for the 3.2 maintenance stream, we never added a new feature inside a maintenance release.
Comment 3 Dorian Birsan CLA 2007-02-02 11:31:21 EST
Hi Olivier,

You're right, it is the equivalent of Export. I've done a quick prototype that basically cleans the jdt.ui.jarpackager from any UI dependency, which seems to work. The current jarpackager code was well organized, so removing the ui stuff took less than an hour. 

I agree this is a feature, and you could perhaps just add a jarpackager package to the jdt.core plugin that mimics the one in jdt.ui. I can attach my code if you want.

Right now I have found a different solution for the product that I work on (and is based on 3.0.2) that does no longer require to go through the JDT export code, so the original "critical" severity is not needed. 

Alex, thanks for the suggestions. I ended up using other proprietary code that already existed in our product.

Olivier, while it would be nice to have the function in 3.2, I totally understand your argument, so please feel free to make it available in 3.3 only.
I am actually surprised nobody has asked for this feature. As Alex mentions, pde build already does something similar.

Thanks!
Comment 4 Dani Megert CLA 2007-02-02 12:20:55 EST
I guess most people that do this headless simply use Ant.