Skip to content
Permalink
Browse files

[JENKINS-22367] Split JDKInstaller to a plugin (#3301)

* [JENKINS-22367] Preparation for split of JDKInstaller to a plugin

* Add split-plugins entry and pending update to war/pom.xml

* Update jdk-tool plugin description

* Fix Findbugs warnings

* Update to HttpComponents Client 4.5

* Preserve formatting in translations of Messages.properties

* Preserve ISO-8859-1 encoding for properties

* Break cycle between jdk-tool and apache-httpcomponents-client-4-api

* Update version numbers after merge

* Add warning for the download from java.sun.com JDK installer

* Fix issues introduced when cleaning up Findbugs errors in 9dbf833

* Use warning class for error message and adjust message text

* Revert "Update to HttpComponents Client 4.5"

This reverts commit 9dbf833.

* Findbugs

* Remove JenkinsRule from test that does not use it

* Update version numbers after merge

* Warn when unexpected exceptions are thrown and update new plugin urls

* Update to 2.109-SNAPSHOT

* Address review feedback

* Update to 2.111-SNAPSHOT

* Try to use the agent's default charset to copy the install log

* Update to 2.112-SNAPSHOT

* Remove local module and use snapshot of jdk-tool

* Update to jdk-tool:1.0
  • Loading branch information
dwnusbaum committed Mar 16, 2018
1 parent f7d3e15 commit f0819d2585bdf212ca1928146d1fa8e50cc3025c
Showing with 29 additions and 2,251 deletions.
  1. +19 −3 core/src/main/java/hudson/model/JDK.java
  2. +0 −967 core/src/main/java/hudson/tools/JDKInstaller.java
  3. +0 −34 core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/credentialOK.jelly
  4. +0 −26 core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/credentialOK_bg.properties
  5. +0 −4 core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/credentialOK_de.properties
  6. +0 −24 core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/credentialOK_es.properties
  7. +0 −24 core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/credentialOK_it.properties
  8. +0 −25 core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/credentialOK_ja.properties
  9. +0 −4 core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/credentialOK_pt_BR.properties
  10. +0 −4 core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/credentialOK_sr.properties
  11. +0 −24 core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/credentialOK_zh_TW.properties
  12. +0 −52 core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/enterCredential.jelly
  13. +0 −23 core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/enterCredential.properties
  14. +0 −34 core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/enterCredential_bg.properties
  15. +0 −7 core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/enterCredential_de.properties
  16. +0 −28 core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/enterCredential_es.properties
  17. +0 −27 core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/enterCredential_it.properties
  18. +0 −28 core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/enterCredential_ja.properties
  19. +0 −28 core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/enterCredential_pt_BR.properties
  20. +0 −7 core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/enterCredential_sr.properties
  21. +0 −27 core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/enterCredential_zh_TW.properties
  22. +0 −50 core/src/main/resources/hudson/tools/JDKInstaller/config.jelly
  23. +0 −26 core/src/main/resources/hudson/tools/JDKInstaller/config_bg.properties
  24. +0 −4 core/src/main/resources/hudson/tools/JDKInstaller/config_ca.properties
  25. +0 −24 core/src/main/resources/hudson/tools/JDKInstaller/config_da.properties
  26. +0 −3 core/src/main/resources/hudson/tools/JDKInstaller/config_de.properties
  27. +0 −3 core/src/main/resources/hudson/tools/JDKInstaller/config_en_GB.properties
  28. +0 −24 core/src/main/resources/hudson/tools/JDKInstaller/config_es.properties
  29. +0 −3 core/src/main/resources/hudson/tools/JDKInstaller/config_fi.properties
  30. +0 −24 core/src/main/resources/hudson/tools/JDKInstaller/config_fr.properties
  31. +0 −4 core/src/main/resources/hudson/tools/JDKInstaller/config_he.properties
  32. +0 −4 core/src/main/resources/hudson/tools/JDKInstaller/config_it.properties
  33. +0 −26 core/src/main/resources/hudson/tools/JDKInstaller/config_ja.properties
  34. +0 −4 core/src/main/resources/hudson/tools/JDKInstaller/config_lt.properties
  35. +0 −3 core/src/main/resources/hudson/tools/JDKInstaller/config_lv.properties
  36. +0 −24 core/src/main/resources/hudson/tools/JDKInstaller/config_nl.properties
  37. +0 −3 core/src/main/resources/hudson/tools/JDKInstaller/config_pl.properties
  38. +0 −24 core/src/main/resources/hudson/tools/JDKInstaller/config_pt_BR.properties
  39. +0 −4 core/src/main/resources/hudson/tools/JDKInstaller/config_pt_PT.properties
  40. +0 −24 core/src/main/resources/hudson/tools/JDKInstaller/config_ru.properties
  41. +0 −3 core/src/main/resources/hudson/tools/JDKInstaller/config_sk.properties
  42. +0 −4 core/src/main/resources/hudson/tools/JDKInstaller/config_sr.properties
  43. +0 −24 core/src/main/resources/hudson/tools/JDKInstaller/config_sv_SE.properties
  44. +0 −2 core/src/main/resources/hudson/tools/JDKInstaller/config_zh_CN.properties
  45. +0 −25 core/src/main/resources/hudson/tools/JDKInstaller/config_zh_TW.properties
  46. +0 −6 core/src/main/resources/hudson/tools/Messages.properties
  47. +0 −16 core/src/main/resources/hudson/tools/Messages_bg.properties
  48. +0 −5 core/src/main/resources/hudson/tools/Messages_da.properties
  49. +0 −6 core/src/main/resources/hudson/tools/Messages_de.properties
  50. +0 −6 core/src/main/resources/hudson/tools/Messages_es.properties
  51. +0 −6 core/src/main/resources/hudson/tools/Messages_it.properties
  52. +0 −7 core/src/main/resources/hudson/tools/Messages_ja.properties
  53. +0 −12 core/src/main/resources/hudson/tools/Messages_pt_BR.properties
  54. +0 −6 core/src/main/resources/hudson/tools/Messages_sr.properties
  55. +0 −5 core/src/main/resources/hudson/tools/Messages_zh_CN.properties
  56. +0 −6 core/src/main/resources/hudson/tools/Messages_zh_TW.properties
  57. +2 −0 core/src/main/resources/jenkins/split-plugin-cycles.txt
  58. +2 −0 core/src/main/resources/jenkins/split-plugins.txt
  59. +0 −19 test/src/test/java/hudson/model/DownloadServiceTest.java
  60. +0 −121 test/src/test/java/hudson/tools/JDKInstallerTest.java
  61. +0 −69 test/src/test/resources/hudson/model/hudson.tools.JDKInstaller1.json
  62. +0 −46 test/src/test/resources/hudson/model/hudson.tools.JDKInstaller2.json
  63. +0 −69 test/src/test/resources/hudson/model/hudson.tools.JDKInstaller3.json
  64. +0 −107 test/src/test/resources/hudson/model/hudson.tools.JDKInstallerResult.json
  65. +6 −0 war/pom.xml
@@ -32,16 +32,20 @@
import hudson.slaves.NodeSpecific;
import hudson.tools.ToolInstallation;
import hudson.tools.ToolDescriptor;
import hudson.tools.ToolInstaller;
import hudson.tools.ToolProperty;
import hudson.tools.JDKInstaller;
import hudson.util.XStream2;

import java.io.File;
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.Map;
import java.util.List;
import java.util.Arrays;
import java.util.Collections;
import java.util.logging.Level;
import java.util.logging.Logger;

import jenkins.model.Jenkins;
import org.jenkinsci.Symbol;
@@ -183,8 +187,18 @@ public String getDisplayName() {
}

@Override
public List<JDKInstaller> getDefaultInstallers() {
return Collections.singletonList(new JDKInstaller(null,false));
public List<? extends ToolInstaller> getDefaultInstallers() {
try {
Class<? extends ToolInstaller> jdkInstallerClass = Jenkins.getInstance().getPluginManager()
.uberClassLoader.loadClass("hudson.tools.JDKInstaller").asSubclass(ToolInstaller.class);
Constructor<? extends ToolInstaller> constructor = jdkInstallerClass.getConstructor(String.class, boolean.class);
return Collections.singletonList(constructor.newInstance(null, false));
} catch (ClassNotFoundException e) {
return Collections.emptyList();
} catch (Exception e) {
LOGGER.log(Level.WARNING, "Unable to get default installer", e);
return Collections.emptyList();
}
}

/**
@@ -211,4 +225,6 @@ public String getDisplayName() {
return ((JDK)obj).javaHome;
}
}

private static final Logger LOGGER = Logger.getLogger(JDK.class.getName());
}

0 comments on commit f0819d2

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