Skip to content
Permalink
Browse files

[JENKINS-21486] Check Jenkins version if the flag is set

And don't fail if no version can be found.
  • Loading branch information...
Vlatombe committed Apr 1, 2016
1 parent 57e73a3 commit 91e8400ea1ced342c5f11a6499c91beee56542ba
Showing with 8 additions and 6 deletions.
  1. +8 −6 core/src/main/java/hudson/PluginWrapper.java
@@ -549,12 +549,14 @@ public boolean hasLicensesXml() {
* 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>();

0 comments on commit 91e8400

Please sign in to comment.
You can’t perform that action at this time.