Fix version parsing in SQL

I have no idea why this logic was only looking at snapshot JARs (what is
suppose to happen in production?). This breaks the release tests though
which we really need to have stable. This commit fixes this by also
considering non-snapshot JARs.

Original commit: elastic/x-pack-elasticsearch@47020ed3aa
This commit is contained in:
Jason Tedor 2017-12-12 22:15:59 -05:00
parent ffeebc366d
commit 6ceee0be8f
1 changed files with 1 additions and 1 deletions

View File

@ -76,7 +76,7 @@ public abstract class Version {
String ver = "Unknown";
String hash = ver;
if (urlStr.startsWith("file:/") && urlStr.endsWith("-SNAPSHOT.jar")) {
if (urlStr.startsWith("file:/") && urlStr.endsWith(".jar")) {
try (JarInputStream jar = new JarInputStream(url.openStream())) {
Manifest manifest = jar.getManifest();
hash = manifest.getMainAttributes().getValue("Change");