Let me go to the bottom of this problem. During the initial stages of the P2
integration with Carbon, We had several issues with versioning scheme
supported by P2.
Originally P2 could only handle bundles which has the following bundle
naming scheme.
{artifactName}_{version}.jar ---(1)
Then in 2.x branch, We patched P2, in order to get P2 to work with the
following naming scheme which is supported by Maven
{artifactName}-{version}.jar --- (2)
In this scenario, we didn't bother about the {version} segment, because in
Carbon 2.x branch OSGi bundle version and the physical jar version is same.
In addition, when P2 installs features to a product, the installed bundles
have the (2) version scheme.
But in Carbon trunk, OSGi bundle version and the physical jar version is
different. Before changing the Carbon trunk version from 3.0.0.SNAPSHOT to
3.0.0-SNAPSHOT, in a mail thread on carbon-dev I requested not to make this
change. :)
My gut feeling is this, if there is no big issues with 3.0.0.SNAPSHOT
version, we should use it. Without playing with P2 code base.
Thanks
Sameera
On Sat, Jan 16, 2010 at 10:55 AM, Saminda Wijeratne <[email protected]>wrote:
> Patching p2 for handle this involves some core changes. P2 gets to know
> which bundles it needs to install by reading the artifacts.xml and the
> content.xml.
>
> In those metadata files the bundles are defined using the symbolic name and
> the osgi.version, using mapping rules[1]. Thus P2 constructs the bundle name
> according to that rule.
>
> Here the id is the symbolic name (rather than the artifact id of a maven
> artifact) and version is the osgi version. If we are to patch p2 we need to
> introduce new rules to support maven artifact naming and introduction of
> maven artifact properties(maven artifactId and maven.version) to p2
> metadata. or we can introduce the logic to p2 to find and map the required
> bundle among the metadata.
>
> Getting maven stuff inside p2 is going to be messy, but find and map
> bundles is reasonable I think. But as this involves some core operational
> changes in p2, we'll try to provide patches to p2 project in eclipse so that
> we wont be significantly forking their code.
>
> Saminda
>
> [1] <rule filter='(& (classifier=osgi.bundle))'
> output='${repoUrl}/plugins/${id}-${version}.jar'/>
> extracted from artifact xml.
>
>
> On Sat, Jan 16, 2010 at 8:11 AM, Ruwan Linton <[email protected]> wrote:
>
>> I thought we got rid of this issue by patching P2, but seems like this
>> is a hack :-( So what we have done is we have renamed the jar at the
>> package time keeping it in the maven way at the build time :-)
>>
>> Why don't we try to do it right, is it extremely hard to do that?
>>
>> Thanks,
>> Ruwan
>>
>> Saminda Wijeratne wrote:
>> >
>> >
>> > On Fri, Jan 15, 2010 at 3:16 PM, Sameera Jayasoma <[email protected]
>> > <mailto:[email protected]>> wrote:
>> >
>> >
>> >
>> > On Fri, Jan 15, 2010 at 3:14 PM, Sameera Jayasoma
>> > <[email protected] <mailto:[email protected]>> wrote:
>> >
>> >
>> >
>> > On Fri, Jan 15, 2010 at 2:50 PM, Nuwan Bandara <[email protected]
>> > <mailto:[email protected]>> wrote:
>> >
>> > Hi guys,
>> >
>> > While I was working in the carbon.ui bundle in the trunk,
>> > I noticed that the carbon ui bundle in the carbon
>> > distribution is named as
>> > org.wso2.carbon.ui-*3.0.0.SNAPSHOT* but the actual jar
>> > which is (in the carbon.ui target) getting created is
>> > org.wso2.carbon.ui-*3.0.0-SNAPSHOT*. I also checked the
>> > carbon distribution and parent poms and the version is
>> > correctly typed as *3.0.0-SNAPSHOT. *The real problem is
>> > when a product is built some of the carbon core bundles
>> > (not only the carbon.ui bundle) come in to the plugins
>> > directory as *3.0.0.SNAPSHOT*. Any idea on this issue ?
>> >
>> >
>> > Your observations are correct. Even though we have configured
>> > Maven to produces bundles with the version 3.0.0-SNAPSHOT,
>> > Carbon distribution has bundles with the version
>> > 3.0.0.SNAPSHOT. This is because of P2.
>> >
>> >
>> > Since we are on the subject,
>> >
>> > Maven version : "x.y.z-abc" is the correct format of the version of an
>> > artifact
>> > osgi version : "x.y.z.abc" is the correct format of the version of a
>> > bundle (chk the MANIFEST.MF), but the file name of the bundle can
>> > contain any character.
>> > for p2: filename of the bundle should be in the format
>> > "<bundle_symbolicname>_<osgi_version>.jar"
>> >
>> > The maven bundle plugin updates the version of the bundle in the
>> > manifest file (converting the "-" to a ".") but does not attempt to do
>> > so for the file name of the bundle since it doesn't really care abt
>> > the filename. But p2 does. Therefore in the carbon-p2-plugin we create
>> > bundles with p2 compatible file names when creating features.
>> >
>> > Saminda
>> >
>> >
>> > In Carbon trunk, bundles are no longer copied to the
>> > distribution by Maven. We are using P2 for this purpose now.
>> > P2 always produces bundles with the version format
>> > x.x.x.qualifier.
>> >
>> >
>> > I guess we may need to patch certain P2 bundles to get it right.
>> >
>> > Sameera
>> >
>> >
>> > Sameera
>> >
>> >
>> > Thanks & Regards
>> > --
>> > Nuwan Bandara
>> > WSO2 Inc. | http://www.wso2.com
>> > email: [email protected] <mailto:[email protected]>
>> > mob: +94 772 907 484
>> > blog: http://www.nuwanbando.com
>> >
>> > _______________________________________________
>> > Carbon-dev mailing list
>> > [email protected] <mailto:[email protected]>
>> > https://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
>> >
>> >
>> >
>> >
>> > _______________________________________________
>> > Carbon-dev mailing list
>> > [email protected] <mailto:[email protected]>
>> > https://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
>> >
>> >
>> > ------------------------------------------------------------------------
>> >
>> > _______________________________________________
>> > Carbon-dev mailing list
>> > [email protected]
>> > https://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
>> >
>>
>>
>> _______________________________________________
>> Carbon-dev mailing list
>> [email protected]
>> https://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
>>
>
>
> _______________________________________________
> Carbon-dev mailing list
> [email protected]
> https://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
>
>
_______________________________________________
Carbon-dev mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev