Github user neykov commented on the issue:
https://github.com/apache/brooklyn-server/pull/672
I've been catching up on some of the merged PRs and noticed the following.
When doing `br catalog add .` with the following `catalog.bom` in the folder:
```
brooklyn.catalog:
bundle: org.apache.brooklyn.test
version: "0.1.0-SNAPSHOT"
itemType: entity
item:
type: org.apache.brooklyn.core.test.entity.TestEntity
```
I get the error:
```
Server error (400): invalid version "0.1.0-SNAPSHOT": non-numeric
"0-SNAPSHOT": NumberFormatException: For input string: "0-SNAPSHOT"
```
In `catalog.bom` we are using maven style versioning and the OSGi style of
versioning differs from it, mostly by enforcing a `.`delimiter for the extra
tags. It's not restricted to `SNAPSHOT` versions (which is not a special
version in OSGi). It applies to any tagged version.
The code must take this into account and:
* Convert maven style versions to osgi style versions when initializing
the bundle metadata. There's `OsgiUtils.toOsgiVersion(String)` to do the
mapping which uses the same code as maven does to do the conversion.
* Keep the duality hidden to the internals. The version from
`catalog.bom` should be the one we see the catalog item created with, etc.
* For the case where there's no `catalog.bom` and we rely on the
`MANIFEST.MF` - try to get the maven version and use that for the user-visible
parts. For example `Implementation-Version` header or `pom.properties`.
Fallback to the `Version` header when no alternative source is available.
* The conversion is one way - we can't recover the maven version from an
OSGi version. This means we can't directly map from a bundle version to a
catalog version without additional metadata.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---