Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 318206 - p2 - publishing fragment does not work
Summary: p2 - publishing fragment does not work
Status: CLOSED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P3 blocker with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: P2 Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-28 12:11 EDT by Michael Hüttermann CLA
Modified: 2011-06-12 18:46 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Hüttermann CLA 2010-06-28 12:11:26 EDT
Build Identifier: 20090920-1017

I have the following structure:

win32\eRCP\plugins\xx1.jar
win32\eRCP\plugins\xx2.jar
win32\eRCP\plugins\org.eclipse.ercp.swt.win32_1.3.0\ws\win32\eswt-converged.jar
win32\eRCP\plugins\org.eclipse.ercp.swt.win32_1.3.0\os\win32\x86\eswt-converged.dll

I want to publish my bundles to a p2 repository. I use the following command:

eclipse351\eclipse.exe -application org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher -metadataRepository file:/E:/.../win32/eRCP/plugins/repo -artifactRepository 
file:/E:/.../win32/eRCP/plugins/repo -bundles E:\...\win32\eRCP\plugins -configs ws.win32 -compress -publishArtifacts

The bundles in win32\eRCP\plugins will be published correctly. The fragment win32\eRCP\plugins\org.eclipse.ercp.swt.win32_1.3.0\ws\win32\eswt-converged.jar
is not published. 



Reproducible: Always

Steps to Reproduce:
1. take a fragment (in this example eswt-converged.jar)
2. run the publisher command (like shown above)
3. see that the fragment is not published to the p2 repo
Comment 1 Olivier Thomann CLA 2010-06-28 12:15:29 EDT
Move to Equinox/p2
Comment 2 Andrew Niefer CLA 2010-06-28 17:08:03 EDT
Is there a manifest at
win32/eRCP/plugins/org.eclipse.ercp.swt.win32_1.3.0/META-INF/MANIFEST.MF 

ie, is "org.eclipse.ercp.swt.win32_1.3.0" the fragment (as a folder), or is "eswt-converged.jar" the fragment (as a jar)?
Comment 3 Michael Hüttermann CLA 2010-06-29 04:09:59 EDT
there is a manifest at
win32/eRCP/plugins/org.eclipse.ercp.swt.win32_1.3.0/META-INF/MANIFEST.MF 
with the following content:

Manifest-Version: 1.0
Bundle-Name: eSWT and Mobile Ext. Win32 Fragment
Bundle-ClassPath: ws\win32\eswt-converged.jar
Bundle-Vendor: Eclipse.org
Bundle-ManifestVersion: 2
Fragment-Host: org.eclipse.ercp.swt
Bundle-Localization: plugin
Bundle-SymbolicName: org.eclipse.ercp.swt.win32
Eclipse-PlatformFilter: (& (osgi.ws=win32) (osgi.os=win32) (osgi.arch=
 x86))
Export-Package: com.ibm.ugl,com.ibm.ugl.eswt,com.ibm.ugl.eswt.expanded
 ,com.ibm.ugl.p3ml,org.eclipse.ercp.swt.mobile,org.eclipse.swt,org.ecl
 ipse.swt.browser,org.eclipse.swt.dnd,org.eclipse.swt.events,org.eclip
 se.swt.graphics,org.eclipse.swt.internal,org.eclipse.swt.layout,org.e
 clipse.swt.widgets,org.eclipse.swt.custom
Bundle-Version: 1.3.0
Bundle-Copyright: Copyright (c) 2003, 2005 IBM Corporation and others.
  All rights reserved. This program and the accompanying materials are
  made available under the terms of the Eclipse Public License v1.0 wh
 ich accompanies this distribution, and is available at http://www.ecl
 ipse.org/legal/epl-v10.html



.. and the JAR eswt-converged.jar contains META-INF/MANIFEST.MF:  
Manifest-Version: 1.0
Created-By: 1.4.2 (IBM Corporation)

beside /com/, /org/, /resources/ folders (with content), some properties in root, and an "empty" plugin.xml (only xml root element, an eclipse element, and an empty plugin element).

thanks.
Comment 4 Michael Hüttermann CLA 2010-07-01 09:59:52 EDT
I prepared a small example project (for download) to reproduce the issue:
http://huettermann.net/p2/usecase.zip

My original goal is, I need the (folder) fragment as part of a P2 compatible target platform. 

Open the sample project (part of the ZIP) with Eclipse, and link the target platform to the plugin's folder of the target platform (also part of the ZIP):
..\ercp-target-platform\platform\win32\eRCP\plugins\repo\plugins

result: 
in the Eclipse project, org.eclipse.swt.widgets.Display; cannot be resolved.

In the "..\repo\plugins\" folder, now replace the "org.eclipse.ercp.swt.win32_1.3.0.jar" (that was created with the p2 bundle publisher, see ticket) with the folder fragment org.eclipse.ercp.swt.win32_1.3.0 (by copying the folder ..\plugins\repo\org.eclipse.ercp.swt.win32_1.3.0 (this is the original fragment folder that was published) to the ..\repo\plugins folder. In Eclipse, adding now the folder again as the target platform, now, the import can be resolved. 

Summary: the original fragment (as a folder) can be resolved, but the same fragment as a JAR (as output of the publisher, see ticket) cannot be resolved.

Do you have any hint for me for a workaround?
Comment 5 Michael Hüttermann CLA 2010-07-02 04:23:32 EDT
changing importance to be a blocker: functionality not available (a blocker for us), and no workaround known
Comment 6 Andrew Niefer CLA 2010-07-05 12:48:16 EDT
The published org.eclipse.ercp.swt.win32_1.3.0 jar file looks good to me (ignoring the .svn files in it).

The problem is just that the you need the inner jar to compile against (the compiler doesn't support nested jars on the classpath).  To use this fragment in a target platform, it needs to be transformed into its "runnable" shaped, which is a folder.  The jar is valid in the p2 repo and is the shape you want if you were using that repo as an update site.

I'm guessing you are adding this to your target platform as a "directory".  If you add it as a "Software Site", then PDE will take care of correctly transforming the fragment into a folder for you.  This would require a feature containing all the bundles since the PDE UI only shows feature IUs for adding to the target.

Alternatively, you can manually transform the repository using the repo2runnable application:
eclipse -application org.eclipse.equinox.p2.repository.repo2runnable -source file:/path/eRCP/repo -destination file:path/out/repo
Then you can add the result to the target platform as a directory.


Also, while the publisher is correctly marking the fragment's metadata to be installed as a folder, you might want to be explicit about this and add "Eclipse-BundleShape: dir" to the manifest.
Comment 7 Thomas Watson CLA 2011-05-18 11:48:32 EDT
Is this an issue any more.  I thought PDE now supported nested jars for compiling against.