Remove unnecessary processing of OSGI versions in template-feature-plugin
Description
The template-feature-plugin replaces all dash '-' characters with dots '.' in OSGI version. This processing is redundant and causes issues when dash is present in the version qualifiers.
This method divides a version string like "1.2.3-TEST-SNAPSHOT" into:
String major = 1; String minor = 2; String micro = 3; String qualifier = TEST-SNAPSHOT;
Then divide them with dots so that the result of VersionCleaner.clean() would be "1.2.3.TEST-SNAPSHOT".
Our initial cleanup replaces dashes with dots, so when a custom ODL version with a dash in the qualifier (e.g., "1.2.3-TEST-SNAPSHOT") is processed, it becomes "1.2.3.TEST.SNAPSHOT". The VersionCleaner.clean() method then sees "TEST.SNAPSHOT" as the qualifier, which contains an invalid character '.'. This character is replaced by an underscore '_', resulting in "1.2.3.TEST_SNAPSHOT". This mismatch to the actual feature version causes feature failures.
The template-feature-plugin replaces all dash '-' characters with dots '.' in OSGI version. This processing is redundant and causes issues when dash is present in the version qualifiers.
This method is unnecessary because the result is then passed to the org.apache.karaf.features.internal.mode.Feature#setVersion() method, which also processes the version cleanup using the VersionCleaner.clean() method.
This method divides a version string like "1.2.3-TEST-SNAPSHOT" into:
String major = 1;
String minor = 2;
String micro = 3;
String qualifier = TEST-SNAPSHOT;
Then divide them with dots so that the result of VersionCleaner.clean() would be "1.2.3.TEST-SNAPSHOT".
Our initial cleanup replaces dashes with dots, so when a custom ODL version with a dash in the qualifier (e.g., "1.2.3-TEST-SNAPSHOT") is processed, it becomes "1.2.3.TEST.SNAPSHOT". The VersionCleaner.clean() method then sees "TEST.SNAPSHOT" as the qualifier, which contains an invalid character '.'. This character is replaced by an underscore '_', resulting in "1.2.3.TEST_SNAPSHOT". This mismatch to the actual feature version causes feature failures.