Bug 179407 - Export java project into a jar via headless operation
Summary: Export java project into a jar via headless operation
Status: VERIFIED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.6 M1   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-26 20:18 EDT by Dave Spriet CLA
Modified: 2009-08-03 08:51 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Spriet CLA 2007-03-26 20:18:12 EDT
Build ID: Eclipse 32

Steps To Reproduce:
In our message broker toolkit we have to export (via API ) java projects and produce a resulting jar.  This code must run in eclipse and also headless.

In our previous release we depended on some internal IBM code that was now moved to WTP but this function is no longer available.  So I did some digging and I see no common way to export a java project into a resulting jar file using eclipse and also in our headless command.  

I was going to use ANT but then I ran into a typical problem with the fact that I don’t know the source directory and I can’t hard code this info in an ant build script since it can change at anytime.

Is there a clear API way to export a java project in eclipse 3.2 using an API in eclipse and also works in headless mode?

Dave Spriet
spriet@ca.ibm.com


More information:
Comment 1 Olivier Thomann CLA 2007-03-26 23:48:23 EDT
You might want to see if the new API org.eclipse.jdt.core.JavaCore#getGeneratedResources(IRegion, boolean) meets your needs.
Comment 2 Jerome Lanneluc CLA 2007-03-27 05:39:16 EDT
Note that Dave was asking for an API in Eclipse 3.2. 
So to answer your question Dave, there is no such API in 3.2. As Olivier said, we introduced a new API in the 3.3 stream that would help you. Can you switch to 3.3 M6 ? 

If you can't then you might want to get the project output folders (through IJavaProject#getOutputLocation() and IClasspathEntry#getOutputLocation() if you have output folders per source folders). Then copy the content of those to the jar.
Comment 3 Olivier Thomann CLA 2009-06-25 15:23:02 EDT
Closing as WONTFIX.
Comment 4 Frederic Fusier CLA 2009-08-03 08:51:53 EDT
Verified for 3.6M1