Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 357680 - Maven Virgo Bundlor default "Bundle-Version:" value not in correct OSGi version format when artifact is a SNAPSHOT
Summary: Maven Virgo Bundlor default "Bundle-Version:" value not in correct OSGi versi...
Status: RESOLVED WONTFIX
Alias: None
Product: Virgo
Classification: RT
Component: tooling (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 368782
  Show dependency tree
 
Reported: 2011-09-14 16:03 EDT by Matthew Adams CLA
Modified: 2012-01-17 12:43 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Adams CLA 2011-09-14 16:03:19 EDT
Build Identifier: 1.1.0.M01

This issue is more of a Maven snapshot version syntax versus OSGi version syntax issue.

Maven Virgo Bundlor defaults the "Bundle-Version" header to the Maven value ${project.version}.  If you're using snapshots (very often, IMHO), then you're version is suffixed with "-SNAPSHOT", resulting in, for example, a project version of 1.0.0-SNAPSHOT.

This is not a valid OSGi version string due to the dash instead of a dot after the micro element.

With this issue I'm requesting a reasonable default algorithm to be put in place rather than having the developer manage the version himself.  Given most Maven projects use a version syntax of

major ["." minor ["." micro ["qualifier"]]]

which is not far from OSGi's

major "." minor "." micro ["." "qualifier"]

it seems that a reasonable default algorithm can be supplied to OSGi-ify the Maven version string.

Reproducible: Always

Steps to Reproduce:
1. Use a Maven snapshot project with the "-SNAPSHOT" suffix.
2. Use the Virgo Bundlor without specifying a Bundle-Version.
3. Observe that the resultant Bundle-Version is not OSGi compliant.
Comment 1 Dmitry Sklyut CLA 2011-09-14 16:22:58 EDT
A reasonable solution to this is to use version like 1.0.0.BUILD-SNAPSHOT in maven projects.
Works well with OSGi and Maven.
Comment 2 Matthew Adams CLA 2011-09-14 16:29:18 EDT
Nice.  I should've remembered that -- it's used frequently.
Comment 3 Miles Parker CLA 2012-01-16 18:07:02 EST
Does comment 1 address this bug so that we can close it or set WONT_FIX or would you still like to see another solution?
Comment 4 Matthew Adams CLA 2012-01-16 21:19:59 EST
(In reply to comment #3)
> Does comment 1 address this bug so that we can close it or set WONT_FIX or
> would you still like to see another solution?
WONT_FIX is fine.
Comment 5 Miles Parker CLA 2012-01-17 12:43:07 EST
Thanks Matthew!