Home » Eclipse Projects » Eclipse Platform » P2 and Feature Patch
P2 and Feature Patch [message #528377] |
Tue, 20 April 2010 10:04 |
Stefan Stern Messages: 9 Registered: July 2009 |
Junior Member |
|
|
Hello
We maintain an internal IDE, which we use as development IDE. It comes
with GEF, EMF, Eclipse SDK and some plugins which we develop internally
that extend the Eclipse SDK. All Eclipse features are based on the
latest 3.5.2 releases.
Our internal stuff comes with a feature of its own. All parts are
bundled in a product definition, which defines all features that form
the product. The deployment is done with the Export wizard.
Now we stumbled across the issue, that we need a new version of one of
those plugins, which we develop internally. First thing we tried: make a
new version of the plugin, then increment the version of the feature
which includes the affected bundle, export it into a new P2 repository
and try to update the running IDE. That won't do, as the product defines
the exact feature version it requires. Doing so, prevents the update to
install the new version, as the product won't let it.
OK. So we made a feature patch, based on the version of the existing
feature, updating it to an incremtented version, bringing the new
version of the bundle. We exported that to a new P2 repository, which we
made available as new Software site. When calling "check for update",
the manager tells "none required". That's ok, we talk about a feature
patch, not a new version of the feature. So we call "install new
software", select the feature patch from the P2 repo created before,
performing the installation, restarting the IDE and - surprise - the
feature patch is installed, but the bundle that should have been updated
is just the version it was before! Nothing happened. Provisioning
Metadata of the repo is correct, it tells the feature patch would update
the bundle from any version to the new version. But the feature patch
installation leaves the bundle untouched.
After uninstalling the feature patch, we built a wrapping feature, which
includes the feature patch, and installed that new feature into the IDE.
This caused the feature patch to be installed as well, but again the
bundle remains on its old version.
Do we have to increment the product version, any time we modify
something in any bundle delivered with the product? And then redeploy
the whole new product? Is there no way to update a single bundle to a
new version, in case it is a minor change, if the bundle was delivered
in terms of a product? Or is there something we overlooked in the P2 usage?
Thanks in advance and kind regards,
Stefan Stern
|
|
|
Re: P2 and Feature Patch [message #528507 is a reply to message #528377] |
Tue, 20 April 2010 18:36 |
|
This is a multi-part message in MIME format.
--------------000809000907050408030607
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
The feature patch should update the bundle specified, and you shouldn't
have to update your product (at least I don't believe so).
My own feature patch on the eclipse 3.5 SDK was little more than
standard feature stuff and:
<requires>
<import feature="org.eclipse.rcp" version="3.5.0" patch="true"/>
</requires>
<plugin id="org.eclipse.core.contenttype" download-size="0"
install-size="0" version="0.0.0" unpack="false"/>
It generated a feature IU (attached) with the <changes> element with my
change in it.
<change>
<from>
<required namespace='org.eclipse.equinox.p2.iu'
name='org.eclipse.core.contenttype' range='0.0.0'/>
</from>
<to>
<required namespace='org.eclipse.equinox.p2.iu'
name='org.eclipse.core.contenttype'
range=''/>
</to>
</change>
It also tied it to a very specific version of the feature I was patching.
Did your generated feature patch IU look like mine? Was there any
complaints in the .log?
Later,
PW
--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm
--------------000809000907050408030607
Content-Type: text/xml;
name="feature_patch.xml"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline;
filename="feature_patch.xml"
<unit id=3D'org.eclipse.e4.resources.rcp.patch.feature.group' version=
=3D'0.9.0.v20090609-1530-48Z-7w311A143102241' singleton=3D'false'>
<patchScope>
<scope>
<requires size=3D'1'>
<required namespace=3D'org.eclipse.equinox.p2.iu' name=3D'org=
=2Eeclipse.rcp.feature.group' range=3D''/>
</to>
</change>
</changes>
<lifeCycle>
<required namespace=3D'org.eclipse.equinox.p2.iu' name=3D'org.ecl=
ipse.rcp.feature.group' range=3D'[3.5.0,4.0.0)' greedy=3D'false'/>
</lifeCycle>
<update id=3D'org.eclipse.e4.resources.rcp.patch.feature.group' ran=
ge=3D'[0.0.0,0.9.0.v20090609-1530-48Z-7w311A143102241)' severity=3D'0'/>
<properties size=3D'10'>
<property name=3D'org.eclipse.equinox.p2.type.patch' value=3D'tru=
e'/>
<property name=3D'org.eclipse.equinox.p2.name' value=3D'%featureN=
ame'/>
<property name=3D'org.eclipse.equinox.p2.description' value=3D'%d=
escription'/>
<property name=3D'org.eclipse.equinox.p2.provider' value=3D'%prov=
iderName'/>
<property name=3D'org.eclipse.equinox.p2.type.group' value=3D'tru=
e'/>
<property name=3D'df_LT.featureName' value=3D'Eclipse e4 Resource=
s RCP Patch (Incubation)'/>
<property name=3D'df_LT.copyright' value=3D'Copyright (c) 2000, 2=
008 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
which accompanies this distribution, and=
is available at
http://www.eclipse.org/legal/epl-v10.html

C=
ontributors:
IBM Corporation - initial API and implementation'/>
<property name=3D'df_LT.providerName' value=3D'Eclipse.org'/>
<property name=3D'df_LT.description' value=3D'Eclipse e4 Resource=
s RCP Patch'/>
<property name=3D'df_LT.license' value=3D'ECLIPSE FOUNDATION SOFT=
WARE USER AGREEMENT
March 17, 2005

Usage Of Content

=
;THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMAT=
ION AND/OR
OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY &qu=
ot;CONTENT").
USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CO=
NDITIONS OF THIS
AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE=
AGREEMENTS OR
NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CO=
NTENT, YOU
AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGR=
EEMENT
AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGRE=
EMENTS
OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE =
TO THE
TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDI=
TIONS
OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR RE=
FERENCED
BELOW, THEN YOU MAY NOT USE THE CONTENT.

Applicable=
Licenses

Unless otherwise indicated, all Content made available=
by the Eclipse Foundation
is provided to you under the terms and con=
ditions of the Eclipse Public
License Version 1.0 ("EPL"). =
A copy of the EPL is provided with this
Content and is also available=
at http://www.eclipse.org/legal/epl-v10.html.
For purposes of the EP=
L, "Program" will mean the Content.

Content includes, =
but is not limited to, source code, object code,
documentation and ot=
her files maintained in the Eclipse.org CVS
repository ("Reposit=
ory") in CVS modules ("Modules") and made available
as=
downloadable archives ("Downloads").

- Content may be=
structured and packaged into modules to facilitate delivering,
exten=
ding, and upgrading the Content. Typical modules may include plug-ins (&q=
uot;Plug-ins"),
plug-in fragments ("Fragments"), and f=
eatures ("Features").
- Each Plug-in or Fragment may be pac=
kaged as a sub-directory or JAR (Java? ARchive)
in a directory named =
"plugins".
- A Feature is a bundle of one or more Plug-ins =
and/or Fragments and associated material.
Each Feature may be package=
d as a sub-directory in a directory named "features".
Withi=
n a Feature, files named "feature.xml" may contain a list of th=
e names and version
numbers of the Plug-ins and/or Fragments associat=
ed with that Feature.
- Features may also include other Features (&qu=
ot;Included Features"). Within a Feature, files
named "feat=
ure.xml" may contain a list of the names and version numbers of Incl=
uded Features.

Features may also include other Features ("I=
ncluded Features"). Files named
"feature.xml" may cont=
ain a list of the names and version numbers of
Included Features.
=
;
The terms and conditions governing Plug-ins and Fragments should be=

contained in files named "about.html" ("Abouts")=
=2E The terms and
conditions governing Features and Included Features=
should be contained
in files named "license.html" ("F=
eature Licenses"). Abouts and Feature
Licenses may be located in=
any directory of a Download or Module
including, but not limited to =
the following locations:

- The top-level (root) directory
- =
Plug-in and Fragment directories
- Inside Plug-ins and Fragments pack=
aged as JARs
- Sub-directories of the directory named "src"=
of certain Plug-ins
- Feature directories

Note: if a Featur=
e made available by the Eclipse Foundation is installed using the
Ecl=
ipse Update Manager, you must agree to a license ("Feature Update&#x=
A;License") during the installation process. If the Feature contains=

Included Features, the Feature Update License should either provide =
you
with the terms and conditions governing the Included Features or =
inform
you where you can locate them. Feature Update Licenses may be =
found in
the "license" property of files named "featur=
e.properties". Such Abouts,
Feature Licenses and Feature Update =
Licenses contain the terms and
conditions (or references to such term=
s and conditions) that govern your
use of the associated Content in t=
hat directory.

THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE L=
ICENSES MAY REFER
TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR =
TERMS AND CONDITIONS.
SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCL=
UDE (BUT ARE NOT LIMITED TO):

- Common Public License Version 1.=
0 (available at http://www.eclipse.org/legal/cpl-v10.html)
- Apache S=
oftware License 1.1 (available at http://www.apache.org/licenses/LICENSE)=

- Apache Software License 2.0 (available at http://www.apache.org/li=
censes/LICENSE-2.0)
- IBM Public License 1.0 (available at http://oss=
=2Esoftware.ibm.com/developerworks/opensource/license10.html )
- Metro=
Link Public License 1.00 (available at http://www.opengroup.org/openmoti=
f/supporters/metrolink/license.html)
- Mozilla Public License Version=
1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)

IT I=
S YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR&=
#xA;TO USE OF THE CONTENT. If no About, Feature License or Feature Update=
License
is provided, please contact the Eclipse Foundation to determ=
ine what terms and conditions
govern that particular Content.
&#x=
A;Cryptography

Content may contain encryption software. The coun=
try in which you are
currently may have restrictions on the import, p=
ossession, and use,
and/or re-export to another country, of encryptio=
n software. BEFORE
using any encryption software, please check the co=
untry's laws,
regulations and policies concerning the import, po=
ssession, or use,
and re-export of encryption software, to see if thi=
s is permitted.

Java and all Java-based trademarks are trademark=
s of Sun Microsystems, Inc. in the United States, other countries, or bot=
h.'/>
</properties>
<provides size=3D'2'>
<provided namespace=3D'org.eclipse.equinox.p2.iu' name=3D'org.ecl=
ipse.e4.resources.rcp.patch.feature.group' version=3D'0.9.0.v20090609-153=
0-48Z-7w311A143102241'/>
<provided namespace=3D'org.eclipse.equinox.p2.localization' name=3D=
'df_LT' version=3D'1.0.0'/>
</provides>
<requires size=3D'2'>
<required namespace=3D'org.eclipse.equinox.p2.iu' name=3D'org.ecl=
ipse.e4.resources.rcp.patch.feature.jar' range=3D'[0.9.0.v20090609-1530-4=
8Z-7w311A143102241,0.9.0.v20090609-1530-48Z-7w311A143102241] ' >
<filter>
(org.eclipse.update.install.features=3Dtrue)
</filter>
</required>
<required namespace=3D'org.eclipse.equinox.p2.iu' name=3D'org.ecl=
ipse.rcp.feature.group' range=3D'[3.5.0,4.0.0)' greedy=3D'false'/>
</requires>
<touchpoint id=3D'null' version=3D'0.0.0'/>
<licenses size=3D'1'>
<license uri=3D'%25licenseURL' url=3D'%25licenseURL'>
%license
</license>
</licenses>
<copyright>
%copyright
</copyright>
</unit>
--------------000809000907050408030607--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
|
|
|
Re: P2 and Feature Patch [message #529824 is a reply to message #528507] |
Tue, 27 April 2010 11:24 |
Stefan Stern Messages: 9 Registered: July 2009 |
Junior Member |
|
|
Hi
Thanks for your reply. For testing purpose, I created two plugins, first
with RCP mailapp example wizard for RCP applications, second was a
bundle with a sample action. I configured the mailapp product to be
based on features, created a feature for the product and a feature for
the sample action. The product includes Eclipse Platform Feature, P2.UI
feature, the feature for the RCP mailapp and finally the feature for the
sample action.
Then I deployed the mailapp, could launch it, all fine. Now I created a
feature patch, which updates the sample action feature. I incremented
the version of the sample action bundle, altered the message box text,
deployed the feature patch in a new location, launched the mailapp and
selected "install new software". After pointing to the repo with the
feature patch, the update completes, mailapp restarts and - guess what -
the new bundle was installed.
Phew.
I will check again with the feature patch for my own product or - the
other way round - try to corrupt the mailapp example.
Both repository content.xml look similiar, means have adequate IUs with
proper version ranges and "from" and "to" in the fitting configuration.
I will keep you updated.
Thanks and kind regards,
Stefan Stern
|
|
| |
Goto Forum:
Current Time: Tue Apr 23 09:13:58 GMT 2024
Powered by FUDForum. Page generated in 0.03213 seconds
|