mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-10-28 12:05:19 +00:00
[JENKINS-21486] Check Jenkins version if the flag is set
And don't fail if no version can be found.
This commit is contained in:
1 parent
57e73a3575
commit
91e8400ea1
1 file changed
+8
-6
@@ -549,12 +549,14 @@ public class PluginWrapper implements Comparable<PluginWrapper>, ModelObject {
|
||||
* thrown if one or several mandatory dependencies doesn't exists.
|
||||
*/
|
||||
/*package*/ void resolvePluginDependencies() throws IOException {
|
||||
String requiredCoreVersion = getRequiredCoreVersion();
|
||||
if (requiredCoreVersion == null) {
|
||||
throw new IOException(shortName + " doesn't declare required core version.");
|
||||
} else {
|
||||
if (Jenkins.getVersion().isOlderThan(new VersionNumber(requiredCoreVersion))) {
|
||||
throw new IOException(shortName + " requires a more recent core version (" + requiredCoreVersion + ") than the current (" + Jenkins.getVersion() + ").");
|
||||
if (ENABLE_PLUGIN_DEPENDENCIES_VERSION_CHECK) {
|
||||
String requiredCoreVersion = getRequiredCoreVersion();
|
||||
if (requiredCoreVersion == null) {
|
||||
LOGGER.warning(shortName + " doesn't declare required core version.");
|
||||
} else {
|
||||
if (Jenkins.getVersion().isOlderThan(new VersionNumber(requiredCoreVersion))) {
|
||||
throw new IOException(shortName + " requires a more recent core version (" + requiredCoreVersion + ") than the current (" + Jenkins.getVersion() + ").");
|
||||
}
|
||||
}
|
||||
}
|
||||
List<String> missingDependencies = new ArrayList<String>();
|
||||
|
||||
Reference in new issue
Block a user