Bug 118223 - [jar exporter] 'select depended classes' button
Summary: [jar exporter] 'select depended classes' button
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 enhancement with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 122466 133051 133055 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-11-28 08:02 EST by Rodion Dokhtorenko CLA
Modified: 2007-06-14 10:43 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 Rodion Dokhtorenko CLA 2005-11-28 08:02:21 EST
Hello JDT Team,

please, consider acceptance of the following feature request: we have Java Project  MyMainProject and another Java Project AnotherProject, on some classes of which MyMainProject depends on. (for ex., it's a client-server system with the common communication protocol and/or serializable java-classes). In Eclipse we can easily handle of the such kind dependencies (by Project Properties->Java Build Path->Projects) and Eclipse will build MyMainProject without problems.
But when I EXPORTING MyMainProject as JAR then resulting *.jar is not usable because doesn't contain "external" for this project classes from AnotherProject. Is it possible to add in Export Wizard additional option "Put all required classes into this JAR"? It will be nice and really useful, because Export as JAR time to time means some kind of deploying.

Thanks a lot!
Comment 1 Sam Barnett-Cormack CLA 2005-12-04 09:12:36 EST
Given that, without this, it seems impossible to actually package a stand-alone JAR (as required for a Pure Java application), I would say it was more than an enhancement... the lack of it really does seem to be a bug, IMO.
Comment 2 Olivier Thomann CLA 2005-12-04 10:37:10 EST
Move to JDT/UI
Comment 3 Martin Aeschlimann CLA 2005-12-04 12:30:37 EST
The JAR exporter just exports the files you selected. You can select files in any number of projects you want. 
I see that the 'add dependend' is a nice feature that can save you some clicking, but in general it can't help you looking at it closely to make sure you also have all resources in and classes reached through reflection.

To avoid too many clicks, I recommend you to use a JAR-description file so you can easly rerun an export. Or use ANT to create a JAR.
Comment 4 Sam Barnett-Cormack CLA 2005-12-04 13:26:38 EST
(In reply to comment #3)
> The JAR exporter just exports the files you selected. You can select files in
> any number of projects you want. 
> I see that the 'add dependend' is a nice feature that can save you some
> clicking, but in general it can't help you looking at it closely to make sure
> you also have all resources in and classes reached through reflection.
> 
> To avoid too many clicks, I recommend you to use a JAR-description file so you
> can easly rerun an export. Or use ANT to create a JAR.

I think, perhaps, that I didn't make clear what I meant - I was referring to a more general situation than the original poster, although I realise I didn't make that clear at all :)

Say I want to package up an application that uses SWT (a standalone one), or I want to include my junit test suite in a jar. It's either impossible to actually bundle these into the jar through the eclipse UI, or the way to do so is uninituitive and badly documented... if anyone can point out how one might do this, I'd be very grateful. I know that manually mucking about with an ant file would do the job, but that defeats the object of having a jar exporter in the IDE...

Comment 5 Martin Aeschlimann CLA 2005-12-06 17:24:56 EST
So you want the JAR exporter to even extract class files out of other JAR's like SWT? 
Comment 6 Sam Barnett-Cormack CLA 2005-12-07 04:03:15 EST
(In reply to comment #5)
> So you want the JAR exporter to even extract class files out of other JAR's
> like SWT? 

Or at least include the whole JAR, thus creating a complete self-contained JAR, in line with portability conventions and pure java rules (at least, as reported by O'Reilly, and I tend to trust them).

Essentially, a portable/pure java application should not rely on the system it is to be installed on having any classes available except core platform and standard extension classes. So it would be nice to be able to JAR up such an application.

Comment 7 Martin Aeschlimann CLA 2006-01-04 10:07:00 EST
*** Bug 122466 has been marked as a duplicate of this bug. ***
Comment 8 Markus Keller CLA 2006-03-24 04:57:07 EST
See also bug 83258.
Comment 9 Markus Keller CLA 2006-03-24 04:57:18 EST
*** Bug 133055 has been marked as a duplicate of this bug. ***
Comment 10 Martin Aeschlimann CLA 2006-03-28 07:58:45 EST
*** Bug 133051 has been marked as a duplicate of this bug. ***