Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 340613

Summary: bundle.jar does not build the same as PDE Export does; leads to a wrong JAR
Product: z_Archived Reporter: Matthias Kappeller <mkappeller>
Component: BuckminsterAssignee: buckminster.core-inbox <buckminster.core-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: thomas
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
A sample project
thomas: iplog+
A Path fixing the issue none

Description Matthias Kappeller CLA 2011-03-21 17:53:13 EDT
I do have a Plug-In with multiple source folders and multiple output folders.
One output folder needs to be packed in the Plug-Ins root, the other not.

Project
+ src/java (source folder) -> WEB-INF/classes
+ src/resources (source folder) -> WEB-INF/classes
+ src/webapp (source folder) -> . (root)
+ WEB-INF/classes (output folder)
+ bin (output folder)

build.properties
source.. = src/webapp/
output.. = bin/
bin.includes = META-INF/,\
               .,\
               WEB-INF/classes/
output.WEB-INF/classes/ = WEB-INF/classes/
source.WEB-INF/classes/ = src/java/,\
                          src/resources/


So exporting this Plug-In with PDE (File->Export->Deployable plug-ins and fragments) results in the expected result.
Calling the 'bundle.jar' Action within Buckminster does not lead to the same expected result.

I think the problem is that the 'jar.contents' group of this component does define both output paths as a prerequisite which shoudn't be.
Comment 1 Matthias Kappeller CLA 2011-03-21 17:56:48 EDT
Created attachment 191648 [details]
A sample project

A sample project which does contain the problematic folder structure
Comment 2 Matthias Kappeller CLA 2011-03-21 17:58:45 EDT
Created attachment 191649 [details]
A Path fixing the issue

And finally a Patch for the org.eclipse.buckminster.pde Plug-In which I think will fix the described problem
Comment 3 Thomas Hallgren CLA 2011-03-22 03:29:23 EDT
I fixed this but I chose to not use the patch. After a careful analyze I concluded that the problem was actually twofold:

1. The bin.includes artifact was generated with folders that are actually produced by the eclipse.build action. That's not OK. This artifact should appoint static content, not content that other actions produce. I fixed this by tracking the output.xxx in a map.

2. The jar.content group included the products of the eclipse.build action verbatim. That's fine when the output should end up in the root, but it's not OK when the destination is a folder below the root. When that happens, the product must be rebased so that a subsequent copy creates the folder. This was fixed by injecting a rebased group between the product and the jar.content group.

Thanks a lot for the patch. Even if I ended up with another solution, it was really helpful when analyzing the problem.

The fix was released to helios-maintenance branch, rev 11746 and trunk, rev 11747
Comment 4 Matthias Kappeller CLA 2011-03-22 05:25:54 EDT
Thanks Thomas very much for this fix! Do you know when about this will be released?
Comment 5 Thomas Hallgren CLA 2011-03-22 05:43:31 EDT
It's already been published to our update sites.
Comment 6 Matthias Kappeller CLA 2011-03-22 05:54:54 EDT
Thx a lot!
Comment 7 Thomas Hallgren CLA 2011-03-22 06:24:58 EDT
Comment on attachment 191648 [details]
A sample project

Added a JUnit test using the sample project to o.e.b.pde.test