Bug 432399 - [Import/Export] Export feature not exporting empty folders
Summary: [Import/Export] Export feature not exporting empty folders
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 4.6 M5   Edit
Assignee: Elena Laskavaia CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2014-04-09 04:42 EDT by srikanth CLA
Modified: 2016-01-28 04:38 EST (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description srikanth CLA 2014-04-09 04:42:25 EDT
Export feature is not exporting empty folders.
I am trying to export eclipse product where it have few features, after exporting it i noticed it is not giving the empty folders. I tried to export individual feature which contains empty folder, here I found that it is not exporting empty folders.

My I know how to export feature with empty folders.



Eclipse Java EE IDE for Web Developers.

Version: Juno Service Release 2
Build id: 20130225-0426
OS: Windows 7
Comment 1 Paul Webster CLA 2014-04-09 08:58:10 EDT
See Bug 278402

The fix needs to be cherry-picked over from the history.

commit efdc6a668cffb4b9359c33cac7b80d4231ba7f0d
Author: Oleg Besedin <obesedin>
Date:   Fri Apr 8 15:43:37 2011 +0000

    Bug 278402 - [Import/Export] Export project does not export empty folders

commit c62b5968ca7c0807a57eb979423d8b9f446a5c80
Author: Prakash Rangaraj <prangaraj>
Date:   Wed Oct 14 10:46:44 2009 +0000

    Bug# 278402 [Import/Export] Export project does not export empty folders
    Fixing the failing tests

commit 534ee32f974523fd2245458caa9f52c6a0698160
Author: Prakash Rangaraj <prangaraj>
Date:   Thu Oct 8 06:50:45 2009 +0000

    Bug# 278402  [Import/Export] Export project does not export empty folders
Comment 2 srikanth CLA 2014-04-10 06:38:59 EDT
can you please tell me how to fix this issue in details. I came to know that because of path separator that issue arising, but where can i fix that?
Comment 3 Paul Webster CLA 2014-04-10 08:50:22 EDT
(In reply to srikanth from comment #2)
> can you please tell me how to fix this issue in details. I came to know that
> because of path separator that issue arising, but where can i fix that?

Have a look at the 3 commits in comment #1

You can see the contents in http://git.eclipse.org/c/platform/eclipse.platform.ui.git

PW
Comment 4 srikanth CLA 2014-04-11 02:15:04 EDT
If the issue already fixed in 2011 then why i am getting this in eclipse 2014 juno? Please help me, I cannot setup eclipse source & cannot build it.
Comment 5 Paul Webster CLA 2014-04-11 08:07:01 EDT
(In reply to srikanth from comment #4)
> If the issue already fixed in 2011 then why i am getting this in eclipse
> 2014 juno? Please help me, I cannot setup eclipse source & cannot build it.

Because it wasn't propagated from 3.7 to 4.2.

This won't be fixed until Mars (right now), which is June 2015, without a contribution.

To set up eclipse source and build it, see https://wiki.eclipse.org/Platform_UI/How_to_Contribute

PW
Comment 6 Mickael Istria CLA 2014-10-22 12:01:59 EDT
Shouldn't this be redirected to PDE/UI ?
Comment 7 Paul Webster CLA 2014-10-22 12:15:30 EDT
(In reply to Mickael Istria from comment #6)
> Shouldn't this be redirected to PDE/UI ?

Not if the fix is in eclipse.platform.ui ...
PW
Comment 8 Petr Bodnar CLA 2015-02-28 16:18:03 EST
(In reply to Paul Webster from comment #7)
> (In reply to Mickael Istria from comment #6)
> > Shouldn't this be redirected to PDE/UI ?
> 
> Not if the fix is in eclipse.platform.ui ...
> PW

This issue does seem unrelated to eclipse.platform.ui, the problematic FeatureExportOperation class is part of the eclipse.pde.ui project, so it really should be "redirected to PDE/UI".
Comment 9 Petr Bodnar CLA 2015-02-28 16:28:35 EST
(In reply to Paul Webster from comment #5)
> (In reply to srikanth from comment #4)
> > If the issue already fixed in 2011 then why i am getting this in eclipse
> > 2014 juno? Please help me, I cannot setup eclipse source & cannot build it.
> 
> Because it wasn't propagated from 3.7 to 4.2.
> 
> This won't be fixed until Mars (right now), which is June 2015, without a
> contribution.
> 
> To set up eclipse source and build it, see
> https://wiki.eclipse.org/Platform_UI/How_to_Contribute
> 
> PW

Paul, could you please explain how the fix described at comment 1 "wasn't propagated"? It firstly seems to be in the master branch for some time (what to cherry-pick then?) and secondly, the classes fixed by the commits mentioned doesn't seem to affect exporting of *features* in any way. It seems like an oversight from you? I will try to have a look at the actual code in the meantime...
Comment 10 Petr Bodnar CLA 2015-03-04 17:02:11 EST
Oh, the export operation is pretty complex (and fragile, as most of the things around installing Eclipse plug-ins seem, unfortunately) giving up for now... What I have investigated so far:

1. The export DOES export empty folders when "Generate p2 repository" (for Update Site) is not checked on the "Options" tab in the export wizard.

2. Another option is to run the generated Ant script whose path can be specified on the same tab. Because the p2 repository is never really generated when running the export via the generated script. I would consider this as another BUG to be reported separately.

3. The export method is based on generating temporary Ant build scripts in the first step and then calling various Ant targets (usually "main") from the export method. The various targets seem to call Eclipse back via various custom tasks (<eclipse.*>).

4. The temporary scripts are more or less the same when p2 repository is generated vs. when it isn't. But the differences still probably cause that the resulting "feature.jar" once contains the empty folders and once it doesn't...
Comment 11 Petr Bodnar CLA 2015-03-04 17:23:58 EST
5. When the p2 repository is NOT generated, then also the "META-INF" directory is generated inside the "feature.jar". This can imply that quite a different mechanism is used for assembling the jar contents / packaging the jar.
Comment 12 Paul Webster CLA 2015-03-30 10:35:02 EDT
(In reply to Paul Webster from comment #1)
> See Bug 278402

In theory the commits mentioned in this comment are not in master (they're in another stream).  The first place I'd attack the problem is by making sure the code changes from the mentioned commits are in the files in master.

PW
Comment 13 Petr Bodnar CLA 2015-03-30 10:55:16 EDT
(In reply to Paul Webster from comment #12)

Well, I actually tried to attack from that direction, with no luck. Paul, have you read my comment #9?
Comment 14 Paul Webster CLA 2015-03-30 11:04:46 EDT
Petr, thanks for your patience.  I went back and re-read the problem and your comments, and now understand why my comments aren't making much sense.  Sorry about that.

As Mickael mentioned, this should go to PDE as they're "building and exporting" the feature (it's not just the straight zip to export it).

I'll forward it on, and we can disregard comment #1.

PW
Comment 15 Petr Bodnar CLA 2015-04-03 15:28:24 EDT
OK, I'm glad I could help. Now I wonder what the resolution of this bug will be :)
Comment 16 Eclipse Genie CLA 2015-12-17 21:44:04 EST
New Gerrit change created: https://git.eclipse.org/r/62984
Comment 18 Vikas Chandra CLA 2016-01-25 04:08:50 EST
Elena Laskavaia, can you please verify this bug in a eclipse 4.6 build post 9th Jan 2016
Comment 19 Elena Laskavaia CLA 2016-01-25 12:28:20 EST
Where do I get it? It is not yet on 
http://download.eclipse.org/eclipse/updates/4.6milestones
Comment 20 Marc-André Laperle CLA 2016-01-25 12:41:41 EST
The integration builds have more recent ones:
http://download.eclipse.org/eclipse/updates/4.6-I-builds
Comment 21 Vikas Chandra CLA 2016-01-28 04:38:03 EST
Elena, can you please verify this one?