mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-10-27 11:35:20 +00:00
Rename to minimumJavaVersion to keep the name across tooling
Given this field is present in maven-hpi-plugin, update-center, etc. I think it does not hurt to keep the 'Minimum-Java-Version' name across various usages to help make it clear.
This commit is contained in:
1 parent
27c49bf0a1
commit
29de9aaef6
3 files changed
+16
-14
No files matched your search
@@ -496,13 +496,13 @@ public class PluginWrapper implements Comparable<PluginWrapper>, ModelObject {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the required Java version of this plugin.
|
||||
* @return the required Java version of this plugin.
|
||||
* Returns the minimumJava version of this plugin.
|
||||
* @return the minimum Java version of this plugin.
|
||||
*
|
||||
* @since TODO
|
||||
*/
|
||||
@Exported
|
||||
public @CheckForNull String getRequiredJavaVersion() {
|
||||
public @CheckForNull String getMinimumJavaVersion() {
|
||||
return manifest.getMainAttributes().getValue("Minimum-Java-Version");
|
||||
}
|
||||
|
||||
@@ -757,12 +757,12 @@ public class PluginWrapper implements Comparable<PluginWrapper>, ModelObject {
|
||||
}
|
||||
}
|
||||
|
||||
String requiredJavaVersion = getRequiredJavaVersion();
|
||||
if (requiredJavaVersion != null) {
|
||||
String minimumJavaVersion = getMinimumJavaVersion();
|
||||
if (minimumJavaVersion != null) {
|
||||
// TODO replace with calls to Runtime.version() once we're on Java 9+
|
||||
VersionNumber actualVersion = new VersionNumber(System.getProperty("java.specification.version"));
|
||||
if (actualVersion.isOlderThan(new VersionNumber(requiredJavaVersion))) {
|
||||
versionDependencyError(Messages.PluginWrapper_obsoleteJava(actualVersion.toString(), requiredJavaVersion), actualVersion.toString(), requiredJavaVersion);
|
||||
if (actualVersion.isOlderThan(new VersionNumber(minimumJavaVersion))) {
|
||||
versionDependencyError(Messages.PluginWrapper_obsoleteJava(actualVersion.toString(), minimumJavaVersion), actualVersion.toString(), minimumJavaVersion);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user