Christian created KARAF-5788:
--------------------------------
Summary: karaf-maven-plugin generates feature descriptor with
unexpected snaphot version
Key: KARAF-5788
URL: https://issues.apache.org/jira/browse/KARAF-5788
Project: Karaf
Issue Type: Improvement
Components: karaf-tooling
Affects Versions: 4.2.0.M2, 4.1.5
Reporter: Christian
Hello,
I'm using the karaf-maven-plugin to generate feature descriptors but I discover
that if the related bundle has a SNAPSHOT version, for example "2.0.0-SNAPSHOT"
then the feature generated has a version like "2.0.0.SNAPSHOT" (take note of
the dot instead of the dash). It seems that
the plugin worked well until the R4 (karaf-maven-plugin 3.0.9 generates the
version with the expected dash).
In the plugin code, the [VersionCleaner
|https://github.com/apache/felix/blob/trunk/utils/src/main/java/org/apache/felix/utils/version/VersionCleaner.java].clean()
method used in the
[Feature|https://github.com/apache/karaf/blob/master/features/core/src/main/java/org/apache/karaf/features/internal/model/Feature.java].setVersion()
method is responsible of the problem, the following test:
public static void main(String[] args) {
String res = VersionCleaner.clean("2.0.0-SNAPSHOT");
System.out.println(res);
}
displays:
2.0.0.SNAPSHOT
In the [Karaf user
forum|http://karaf.922171.n3.nabble.com/karaf-maven-plugin-generates-feature-descriptor-with-bad-snaphot-version-td4053313.html],
Jean-Baptiste Onofré says it is a normal result because 2.0.0-SNAPSHOT is not
a valid OSGi version but 2.0.0.SNAPSHOT is.
I think it will be interesting to have a new configuration property like
"useRawVersion"
(default to false) to let user choose if he wants OSGI or Maven version format.
Thanks
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)