Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 357680

Summary: Maven Virgo Bundlor default "Bundle-Version:" value not in correct OSGi version format when artifact is a SNAPSHOT
Product: [RT] Virgo Reporter: Matthew Adams <matthew>
Component: toolingAssignee: Project Inbox <virgo-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: minor    
Priority: P3 CC: dmitry, eclipse, mlippert
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 368782    

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!