Navigation Menu

Skip to content

Commit

Permalink
[JENKINS-21486] Check Jenkins version if the flag is set
Browse files Browse the repository at this point in the history
And don't fail if no version can be found.
  • Loading branch information
Vlatombe committed Apr 1, 2016
1 parent 57e73a3 commit 91e8400
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions core/src/main/java/hudson/PluginWrapper.java
Expand Up @@ -549,12 +549,14 @@ public boolean hasLicensesXml() {
* thrown if one or several mandatory dependencies doesn't exists. * thrown if one or several mandatory dependencies doesn't exists.
*/ */
/*package*/ void resolvePluginDependencies() throws IOException { /*package*/ void resolvePluginDependencies() throws IOException {
String requiredCoreVersion = getRequiredCoreVersion(); if (ENABLE_PLUGIN_DEPENDENCIES_VERSION_CHECK) {
if (requiredCoreVersion == null) { String requiredCoreVersion = getRequiredCoreVersion();
throw new IOException(shortName + " doesn't declare required core version."); if (requiredCoreVersion == null) {
} else { LOGGER.warning(shortName + " doesn't declare required core version.");
if (Jenkins.getVersion().isOlderThan(new VersionNumber(requiredCoreVersion))) { } else {
throw new IOException(shortName + " requires a more recent core version (" + requiredCoreVersion + ") than the current (" + Jenkins.getVersion() + ")."); 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>(); List<String> missingDependencies = new ArrayList<String>();
Expand Down

0 comments on commit 91e8400

Please sign in to comment.