From 22bdbd834f8dd5ab60236c38ada806e99f7dd1f8 Mon Sep 17 00:00:00 2001 From: Marat Radchenko Date: Fri, 18 Oct 2019 10:01:44 +0300 Subject: [PATCH 1/3] Bump jenkins-test-harness to 2.56 --- test-pom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-pom/pom.xml b/test-pom/pom.xml index 832cd72e4820..f725692b9ed7 100644 --- a/test-pom/pom.xml +++ b/test-pom/pom.xml @@ -71,7 +71,7 @@ THE SOFTWARE. ${project.groupId} jenkins-test-harness - 2.55 + 2.56 test From 5315b9db757e6e5f1645e16312b46b81aa1eda49 Mon Sep 17 00:00:00 2001 From: Marat Radchenko Date: Fri, 18 Oct 2019 14:52:08 +0300 Subject: [PATCH 2/3] Update hamcrest to use 2.x packaging See jenkinsci/jenkins-test-harness#161 --- core/pom.xml | 14 +++++++++++++- pom.xml | 1 + test-pom/pom.xml | 15 ++++++++++++++- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index 0402553742ec..3d7eb73af677 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -189,10 +189,22 @@ THE SOFTWARE. jenkins-stapler-support 1.1 + + org.hamcrest + hamcrest + ${hamcrest.version} + test + + + org.hamcrest + hamcrest-core + ${hamcrest.version} + test + org.hamcrest hamcrest-library - 1.3 + ${hamcrest.version} test diff --git a/pom.xml b/pom.xml index c9e2c832b6ac..907b2cbbb1e5 100755 --- a/pom.xml +++ b/pom.xml @@ -91,6 +91,7 @@ THE SOFTWARE. https://api.github.com jenkins-jira + 2.1 2.3 1.14 0.11 diff --git a/test-pom/pom.xml b/test-pom/pom.xml index f725692b9ed7..09139993550e 100644 --- a/test-pom/pom.xml +++ b/test-pom/pom.xml @@ -164,10 +164,23 @@ THE SOFTWARE. + + org.hamcrest + hamcrest + ${hamcrest.version} + test + org.hamcrest hamcrest-core - 1.3 + ${hamcrest.version} + test + + + org.hamcrest + hamcrest-library + ${hamcrest.version} + test From 7e92923294b51c89b82b8a3cdece0db8c3f38cf8 Mon Sep 17 00:00:00 2001 From: Marat Radchenko Date: Thu, 24 Oct 2019 09:59:54 +0300 Subject: [PATCH 3/3] Force garbage collection after stopping plugins Java doesn't have any direct means to release unreferenced classloaders, so we force GC to do that so it becomes possible to delete plugin jar on Windows. --- core/src/main/java/hudson/PluginManager.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/main/java/hudson/PluginManager.java b/core/src/main/java/hudson/PluginManager.java index 0084d02d3fa6..a8eee118ac41 100644 --- a/core/src/main/java/hudson/PluginManager.java +++ b/core/src/main/java/hudson/PluginManager.java @@ -1331,6 +1331,7 @@ public PluginWrapper whichPlugin(Class c) { /** * Orderly terminates all the plugins. */ + @SuppressFBWarnings(value = "DM_GC", justification = "Garbage collection is required to release files held by plugin classloaders") public void stop() { for (PluginWrapper p : activePlugins) { p.stop(); @@ -1340,6 +1341,9 @@ public void stop() { // Work around a bug in commons-logging. // See http://www.szegedi.org/articles/memleak.html LogFactory.release(uberClassLoader); + // Java doesn't have any direct means to release unreferenced classloaders, + // so we force GC to do that so it becomes possible to delete plugin jar on Windows. + System.gc(); } /**