mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-10-31 13:35:19 +00:00
Revert JENKINS-20679 (support for plugin Java requirement metadata) (#6549)
Co-authored-by: Tim Jacomb <timjacomb1+github@gmail.com>
This commit is contained in:
1 parent
bd7bdc327c
commit
aa0513ee10
20 files changed
+13
-297
No files matched your search
@@ -43,7 +43,6 @@ import hudson.model.ModelObject;
|
||||
import hudson.model.UpdateCenter;
|
||||
import hudson.model.UpdateSite;
|
||||
import hudson.util.VersionNumber;
|
||||
import io.jenkins.lib.versionnumber.JavaSpecificationVersion;
|
||||
import java.io.Closeable;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -75,7 +74,6 @@ import jenkins.plugins.DetachedPluginsUtil;
|
||||
import jenkins.security.UpdateSiteWarningsMonitor;
|
||||
import jenkins.util.AntClassLoader;
|
||||
import jenkins.util.URLClassLoader2;
|
||||
import jenkins.util.java.JavaUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.kohsuke.accmod.Restricted;
|
||||
@@ -690,20 +688,6 @@ public class PluginWrapper implements Comparable<PluginWrapper>, ModelObject {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the minimum Java version of this plugin, as specified in the plugin metadata.
|
||||
* Generally coming from the {@code java.level} extracted as MANIFEST's metadata with
|
||||
* <a href="https://github.com/jenkinsci/plugin-pom/pull/134">this addition on the plugins' parent pom</a>.
|
||||
*
|
||||
* @see <a href="https://github.com/jenkinsci/maven-hpi-plugin/pull/75">maven-hpi-plugin#PR-75</a>
|
||||
*
|
||||
* @since 2.158
|
||||
*/
|
||||
@Exported
|
||||
public @CheckForNull String getMinimumJavaVersion() {
|
||||
return manifest.getMainAttributes().getValue("Minimum-Java-Version");
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the version number of this plugin
|
||||
*/
|
||||
@@ -958,14 +942,6 @@ public class PluginWrapper implements Comparable<PluginWrapper>, ModelObject {
|
||||
versionDependencyError(Messages.PluginWrapper_obsoleteCore(Jenkins.getVersion().toString(), requiredCoreVersion), Jenkins.getVersion().toString(), requiredCoreVersion);
|
||||
}
|
||||
}
|
||||
|
||||
String minimumJavaVersion = getMinimumJavaVersion();
|
||||
if (minimumJavaVersion != null) {
|
||||
JavaSpecificationVersion actualVersion = JavaUtils.getCurrentJavaRuntimeVersionNumber();
|
||||
if (actualVersion.isOlderThan(new JavaSpecificationVersion(minimumJavaVersion))) {
|
||||
versionDependencyError(Messages.PluginWrapper_obsoleteJava(actualVersion.toString(), minimumJavaVersion), actualVersion.toString(), minimumJavaVersion);
|
||||
}
|
||||
}
|
||||
}
|
||||
// make sure dependencies exist
|
||||
for (Dependency d : dependencies) {
|
||||
|
||||
Reference in new issue
Block a user