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

Bug 158589

Summary: Export deployable plugins/features wizards fails with target plugins imported
Product: [Eclipse Project] PDE Reporter: Matthew Dickie <m.dickie>
Component: BuildAssignee: pde-build-inbox <pde-build-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: aniefer, baumanbr, m.dickie
Version: 3.2   
Target Milestone: 3.3 M3   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Attachments:
Description Flags
pde build patch none

Description Matthew Dickie CLA 2006-09-25 12:11:10 EDT
The Export deployable plug-ins and export deployable features wizards fail for me when I have imported plugins from the target platform into the workspace.

The wizards (both of them) report that building the plug-ins failed and that a log.zip file has been created. Inside the log.zip file are error logs for each plugin essentially indicating that none of the Eclipse classes could be found.

When I delete the imported plug-in projects from my workspace these wizards work without errors.

To replicate:

1. Open the New Plug-in Project wizard and use the template to create the 'Hello World' plugin.
2. Open the Export Deployable Plug-ins wizard and export this plugin. It will work fine.
3. Open the Import Plug-in and Fragments wizard and import all workbench plugins.
4. Now try the Export Deployable Plug-ins wizard again on the 'Hello World' plugin. This fails for me, creating a log.zip file.
Comment 1 Brian Bauman CLA 2006-09-27 18:25:03 EDT
did you import the plugins as a binary project or project with source folder?  The default is binary project.
Comment 2 Matthew Dickie CLA 2006-09-28 06:42:15 EDT
(In reply to comment #1)
> did you import the plugins as a binary project or project with source folder? 
> The default is binary project.

I imported them as binary projects with linked content. The problem only occurs if the projects are imported this way. Importing the plugin projects as binary projects (without linked content) or as projects with source folders works OK.

Comment 3 Brian Bauman CLA 2006-09-29 15:50:25 EDT
The problem here is when a project is imported with linked content, the jar does not actually exist in the file.  When we compute the classpath, we actually find both the jar in the project (which really is not in the project directory) and the absolute path to the real location on the file system.  

I was able to create a fix in PDE Build, but want to get their input.  Not sure if this is the right way to fix the problem, but it seemed to make sense (atleast for someone who has very little experience with PDE Build).
Comment 4 Brian Bauman CLA 2006-09-29 15:53:14 EDT
Created attachment 51197 [details]
pde build patch

Adds a check to see if library path is absolute before appending it to basePath.  It seemed the libraryName was absolute to the actual location of the linked resource.  When it was appended to the basePath, it was no longer accurately referencing the proper location.
Comment 5 Andrew Niefer CLA 2006-09-29 16:25:50 EDT
*** Bug 153311 has been marked as a duplicate of this bug. ***
Comment 6 Andrew Niefer CLA 2006-10-02 15:01:39 EDT
Patch is good, released to head for M3
Comment 7 Matthew Dickie CLA 2007-10-29 10:26:56 EDT
This bug is not fixed. In Eclipse 3.3.1 I have a product that requires a number of plugins, only one of which has been imported to the workspace as a binary project  with linked content. Although no errors are reported when building the product, when the product is run a NoClassDefException occurs for one of the classes in the imported plug-in.
Comment 8 Andrew Niefer CLA 2007-10-29 10:53:40 EDT
(In reply to comment #7)
Matthew, there is/was more than one problem with building with linked content.  We ended up using this for problems with the generated classpath.  We have a second bug 168365 which is about packaging the results.  Since you are no longer getting an error message when building, I would say you are hitting bug 168365 instead.

I would prefer to use bug 168365 to track any further changes.  Please only re-open this bug if there are problems with the classpath entries for the linked content in the generated build.xml.