In FilenameExposer.java:35-40, the regex only matches a single digit:
private static final Pattern VERSION_PATTERN = Pattern.compile("-\\\\d"); // only matches single digit!
// ...
identification.addVersion(filename.substring(mat.end() - 1));
For a file like my-lib-12.3.4.jar:
mat.find() matches -1 at position 6-8
mat.end() - 1 = 7 ⇒ filename.substring(7) = 2.3.4
The expected result is 12.3.4. The pattern -\\\\d only matches - followed by a single digit, so any version starting with a multi-digit number (e.g., 10, 12, 21) gets its first digit lopped off. This produces incorrect artifact identification for versions >= 10.
In
FilenameExposer.java:35-40, the regex only matches a single digit:For a file like
my-lib-12.3.4.jar:mat.find()matches-1at position 6-8mat.end() - 1= 7 ⇒filename.substring(7)=2.3.4The expected result is
12.3.4. The pattern-\\\\donly matches-followed by a single digit, so any version starting with a multi-digit number (e.g.,10,12,21) gets its first digit lopped off. This produces incorrect artifact identification for versions >= 10.