Steven E. Harris wrote:
Here's a fix:
private void addBundleVersion() {
// Maven uses a '-' to separate the version qualifier,
// while OSGi uses a '.', so we need to convert the first '-' to a
'.'
final String version =
project.getVersion().replaceFirst("((^|\\.)[0-9]+)-",
"$1.");
osgiManifest.setBundleVersion(version);
}
I won't claim to completely understand the regex, but looking at this is
it completely correct? The OSGi version must
"<number>.<number>.<number>.<qualifier>". Is this just replacing the
first "-" to a "."? If so, it won't be correct either, since "1.0-foo"
would be converted to "1.0.foo", instead of "1.0.0.foo"...
-> richard