The units.*.properties.* entries are published into the IU and serve for a number of things like the plug-in name, the plugin provider etc. Unless you define your IU entirely in p2.inf (which I don't think is the case for you), you usually get those for free from the manifest.mf, feature.xml and others.

Here is an example of the properties for the com.ibm.icu IU

<property name='df_LT.pluginName' value='International Components for Unicode for Java (ICU4J)'/>
        <property name='df_LT.providerName' value='IBM Corporation'/>
        <property name='org.eclipse.equinox.p2.name' value='%pluginName'/>
<property name='org.eclipse.equinox.p2.provider' value='%providerName'/> <property name='org.eclipse.equinox.p2.bundle.localization' value='plugin'/>

HTH

Pascal

On 10/29/2016 12:31 PM, Evgeny Mandrikov wrote:
Seems that I made a stupid copy-paste mistake - m2e-wtp has osgi bundle "org.eclipse.m2e.wtp", but in our case should be "com.mountainminds.eclemma.core" instead of "com.mountainminds.eclemma":

requires.0.name <http://requires.0.name>=com.mountainminds.eclemma.core
units.1.id <http://units.1.id>=com.mountainminds.eclemma.core
units.1.provides.0.name <http://units.1.provides.0.name>=com.mountainminds.eclemma.core

So excuse me for a noise - all seems to work fine after this fix.

Still interested in explanation of values for "units.1.properties.0.name <http://units.1.properties.0.name>" and "units.1.properties.0.value" since can't manage to see them in UI, but this is minor.

Thanks.


On Sat, Oct 29, 2016 at 3:27 PM, Evgeny Mandrikov <[email protected] <mailto:[email protected]>> wrote:

    Hi P2 experts,

    We are preparing initial release of EclEmma
    <https://projects.eclipse.org/projects/technology.eclemma
    <https://projects.eclipse.org/projects/technology.eclemma>> under
    Eclipse Foundation umbrella.
    And we would like to provide for our users smooth transition from
    its ancestor <https://github.com/jacoco/eclemma
    <https://github.com/jacoco/eclemma>>.

    So as was advised by our mentor Mickael Istria - based on
    
<https://github.com/eclipse/m2e.wtp/blob/master/org.eclipse.m2e.wtp.feature/p2.inf
    
<https://github.com/eclipse/m2e.wtp/blob/master/org.eclipse.m2e.wtp.feature/p2.inf>>
    I've tried to create p2.inf
    Here is its content with comments describing my assumptions:

    ###

    # can update any "com.mountainminds.eclemma.feature" and previous
    versions of "org.eclipse.eclemma.feature"
    update.matchExp = providedCapabilities.exists(pc | pc.namespace
    \=\= 'org.eclipse.equinox.p2.iu' && (pc.name <http://pc.name> \=\=
    'com.mountainminds.eclemma.feature.feature.group' || pc.name
    <http://pc.name> \=\= 'org
    .eclipse.eclemma.feature.feature.group' && pc.version < '$version$'))

    # requires additional IU described below
    requires.0.namespace=osgi.bundle
    requires.0.name <http://requires.0.name>=com.mountainminds.eclemma
    requires.0.range=[$version$, $version$]

    units.1.id <http://units.1.id>=com.mountainminds.eclemma
    units.1.version=$version$
    units.1.singleton=true
    units.1.provides.0.namespace=osgi.bundle
    units.1.provides.0.name
    <http://units.1.provides.0.name>=com.mountainminds.eclemma
    units.1.provides.0.version=$version$

    # to not overwrite the main artifact, the additional IU should
    have classifier
    (https://bugs.eclipse.org/bugs/show_bug.cgi?id=430728
    <https://bugs.eclipse.org/bugs/show_bug.cgi?id=430728>)
    units.1.properties.1.name
    <http://units.1.properties.1.name>=maven-classifier
    units.1.properties.1.value=p2inf

    # TODO explain
    units.1.properties.0.name
    <http://units.1.properties.0.name>=org.eclipse.equinox.p2.name
    <http://org.eclipse.equinox.p2.name>
    units.1.properties.0.value=This version cannot be installed on top
    of the already installed EclEmma plugin. Uninstall the previous
    version and try the install again.

    ###

    And below is a description of performed testing with undesirable
    outcome.

    Using:
     fresh installation of Eclipse IDE for Java Developers (Version:
    Neon.1a Release (4.6.1) Build id: 20161007-1200)
    Given:
     old 2.3.3.201602231923 installed from <http://update.eclemma.org/>
    When:
     installing new one from local build directory
    Then:
     correctly upgraded to 2.3.4.201610291259
    When:
     new build is available and checking for update
    Then:
     correctly upgraded to more newer 2.3.4.201610291310
    When:
     installing old one from <http://update.eclemma.org/>
    Expected:
     failure
    Actual:
     both (2.3.3.201602231923 and 2.3.4.201610291310) are installed

    Any help/ideas are more than welcome.

    Regards,
    Evgeny





--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_


_______________________________________________
p2-dev mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/p2-dev


_______________________________________________
p2-dev mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/p2-dev

Reply via email to