mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-10-28 12:05:19 +00:00
[JENKINS-21486] Fixing optional dependency version resolution. (#2421)
Without it version of optional dependencies is set to "X.Y;resolution:=optional" which causes problems when using hudson.util.VersionNumber comparison methods.
This commit is contained in:
1 parent
a24adb72fa
commit
fa1c03b0d8
2 files changed
+34
-3
No files matched your search
@@ -209,10 +209,10 @@ public class PluginWrapper implements Comparable<PluginWrapper>, ModelObject {
|
||||
if(idx==-1)
|
||||
throw new IllegalArgumentException("Illegal dependency specifier "+s);
|
||||
this.shortName = s.substring(0,idx);
|
||||
this.version = s.substring(idx+1);
|
||||
|
||||
String version = s.substring(idx+1);
|
||||
|
||||
boolean isOptional = false;
|
||||
String[] osgiProperties = s.split(";");
|
||||
String[] osgiProperties = version.split("[;]");
|
||||
for (int i = 1; i < osgiProperties.length; i++) {
|
||||
String osgiProperty = osgiProperties[i].trim();
|
||||
if (osgiProperty.equalsIgnoreCase("resolution:=optional")) {
|
||||
@@ -220,6 +220,11 @@ public class PluginWrapper implements Comparable<PluginWrapper>, ModelObject {
|
||||
}
|
||||
}
|
||||
this.optional = isOptional;
|
||||
if (isOptional) {
|
||||
this.version = osgiProperties[0];
|
||||
} else {
|
||||
this.version = version;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user