diff --git a/Jenkinsfile b/Jenkinsfile index c5b70beab..fee712c54 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,5 +5,9 @@ buildPlugin( useContainerAgent: true, configurations: [ [platform: 'linux', jdk: 21], + [platform: 'windows', jdk: 21], + [platform: 'linux', jdk: 17], [platform: 'windows', jdk: 17], + [platform: 'linux', jdk: 11], + [platform: 'windows', jdk: 11], ]) diff --git a/src/test/java/org/jenkinsci/plugins/prometheus/collectors/jenkins/JenkinsVersionInfoTest.java b/src/test/java/org/jenkinsci/plugins/prometheus/collectors/jenkins/JenkinsVersionInfoTest.java index 638001a64..11408d5d5 100644 --- a/src/test/java/org/jenkinsci/plugins/prometheus/collectors/jenkins/JenkinsVersionInfoTest.java +++ b/src/test/java/org/jenkinsci/plugins/prometheus/collectors/jenkins/JenkinsVersionInfoTest.java @@ -42,9 +42,6 @@ public void testCollectResult() throws Exception { static void setFinalStaticTo123(Field field) throws Exception { field.setAccessible(true); - Field modifiersField = Field.class.getDeclaredField("modifiers"); - modifiersField.setAccessible(true); - modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL); field.set(null, "123"); } diff --git a/src/test/java/org/jenkinsci/plugins/prometheus/collectors/jenkins/NodesOnlineGaugeTest.java b/src/test/java/org/jenkinsci/plugins/prometheus/collectors/jenkins/NodesOnlineGaugeTest.java index 7449d4559..f6ec3a722 100644 --- a/src/test/java/org/jenkinsci/plugins/prometheus/collectors/jenkins/NodesOnlineGaugeTest.java +++ b/src/test/java/org/jenkinsci/plugins/prometheus/collectors/jenkins/NodesOnlineGaugeTest.java @@ -70,9 +70,6 @@ private Node mockNode(String nodeName, boolean isOnline) { static void setFinalStaticTo123(Field field) throws Exception { field.setAccessible(true); - Field modifiersField = Field.class.getDeclaredField("modifiers"); - modifiersField.setAccessible(true); - modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL); field.set(null, "123"); } } \ No newline at end of file