Nicholas Rundle created KARAF-3498:
--------------------------------------
Summary: Wrap deployer extracts invalid version from JAR name
Key: KARAF-3498
URL: https://issues.apache.org/jira/browse/KARAF-3498
Project: Karaf
Issue Type: Bug
Affects Versions: 3.0.1
Reporter: Nicholas Rundle
DeployerUtils.java extractNameVersionType() uses a regex pattern to attempt and
extract a Bundle-SymbolicName and Bundle-Version from the URL of the JAR when
using the Wrap deployer. This regex pattern may extract a version which causes
a NumberFormatException in org.osgi.framework.Version.parseInt()
When using PAX Exam dependent JARs provisioned with mavenBundle are deployed
with a UUID and version as the file name. For example, our maven project
depends on org.json version 20140107. This maven bundle was deployed with the
following JAR name:
37b66f72-d42c-40ff-86ea-972550695850_20140107.jar
The regex pattern in deployer utils inadvertently pulls the version as
"972550695850.0.0.20140107". The major version is too large to parse and
causes an exception.
Since this util method has a fallback to using "0.0.0" in the case of no regex
match, I propose that if a version is extracted the major, minor, and micro
versions be validated and perhaps set to "0" if they cannot be parsed.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)