[
https://issues.apache.org/jira/browse/FELIX-1167?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12711490#action_12711490
]
Stuart McCulloch commented on FELIX-1167:
-----------------------------------------
This all looks correct, the "mangling" is needed to convert Maven versions to
the standard OSGi format.
In OSGi you can only use a qualifier if you have specified the first three
version segments, which means:
3.3-SNAPSHOT in Maven ==> 3.3.0.SNAPSHOT in OSGi
The separator between the numeric version and qualifier also changes, because
OSGi only accepts '.'
Note if the Maven version already contains three segments and a qualifier then
no padding is needed:
3.3.1-SNAPSHOT in Maven ==> 3.3.1.SNAPSHOT in OSGi
Regarding the import version change - this is because the latest Bnd Tool now
uses a relaxed import
policy by default, so the micro segment and qualifier are dropped (because
typically versions with the
same major and minor segments are considered to be binary compatible)
An import of foo;version="3.3" will match against bundles exporting
foo;version="3.3.0.SNAPSHOT"
or bundles exporting foo;version="3.3.1.SNAPSHOT", providing you with
flexibility at deployment time.
( you can choose which micro-update to deploy later on, regardless of which you
compiled against )
If you want a different import version policy this can be configured using the
<_versionpolicy> option:
http://aqute.biz/Code/Bnd#versionpolicy
You can also find the OSGi version spec in the javadocs:
http://www.osgi.org/javadoc/r4v41/org/osgi/framework/Version.html#Version(java.lang.String)
HTH
> Incorrect import and and export versions created for -SNAPSHOT versions
> -----------------------------------------------------------------------
>
> Key: FELIX-1167
> URL: https://issues.apache.org/jira/browse/FELIX-1167
> Project: Felix
> Issue Type: Bug
> Components: Maven Bundle Plugin
> Affects Versions: maven-bundle-plugin-1.4.3, maven-bundle-plugin-2.0.0
> Environment: Maven 2.1.0
> WinXP
> Maven-bundle-plugin 1.4.3 and 2.0.0
> Reporter: Sebb
>
> The bundle plugin mangles the version details if there is a text suffix, e.g.
> 3.3-SNAPSHOT
> The version appears as follows in 1.4.3 and 2.0.0
> Bundle-Version: 3.3.0.SNAPSHOT and
> version="3.3.0.SNAPSHOT" (ExportPackage)
> This is using the following settings:
> <Export-Package>org.apache.commons.*;version=${pom.version}</Export-Package>
> <Import-Package>*</Import-Package>
> In version 1.4.3, the ImportPackages have:
> "3.3.0.SNAPSHOT"
> whereas in 2.0.0, the ImportPackages have:
> version="3.3"
> If the pom.version=3.3.1-SNAPSHOT then the BundleVersion and ExportVersion
> are both OK.
> However, in 2.0.0, the ImportPackage versions are still "3.3".
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.