diff --git a/pom.xml b/pom.xml index 7d644c8..8b068b1 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.jvnet.hudson.plugins analysis-pom - 11.2958.v63511c4c1160 + 12.3140.v667559b_d0470 @@ -40,7 +40,7 @@ - 6 + 7 999999-SNAPSHOT ${project.groupId}.plugin.util.api @@ -49,7 +49,7 @@ 1.4.0 0.8.4 2.0.4 - 5.26.0 + 6.6.0 @@ -320,6 +320,20 @@ .* Use ArrayList rather than List + + true + true + java.annotation.* + @edu.hm.hafner.util.SuppressMutation.* + PitMute Annotations are not relevant in API + + + true + true + java.annotation.* + edu.hm.hafner.util.SuppressMutation.* + PitMute Annotations are not relevant in API + diff --git a/src/main/java/io/jenkins/plugins/util/AgentFileVisitor.java b/src/main/java/io/jenkins/plugins/util/AgentFileVisitor.java index 67161b5..559d26c 100644 --- a/src/main/java/io/jenkins/plugins/util/AgentFileVisitor.java +++ b/src/main/java/io/jenkins/plugins/util/AgentFileVisitor.java @@ -223,7 +223,7 @@ public String[] invoke(final File workspace, final VirtualChannel channel) { * * @return the file names of all found files */ - public String[] find(final File workspace) { + String[] find(final File workspace) { try { var fileSet = new FileSet(); var antProject = new Project(); diff --git a/src/test/java/io/jenkins/plugins/util/IntegrationTest.java b/src/test/java/io/jenkins/plugins/util/IntegrationTest.java index e76813a..77fda7d 100644 --- a/src/test/java/io/jenkins/plugins/util/IntegrationTest.java +++ b/src/test/java/io/jenkins/plugins/util/IntegrationTest.java @@ -746,9 +746,18 @@ protected void makeFileUnreadable(final String absolutePath) { private void setAccessModeOnWindows(final String path, final String command, final String accessMode) { try { - var process = Runtime.getRuntime() - .exec("icacls \"" + path + "\" " + command + " *S-1-1-0:" + accessMode); - process.waitFor(); + var process = new ProcessBuilder("icacls", + path, command, "*S-1-1-0:" + accessMode) + .redirectErrorStream(true) + .start(); + var exitCode = process.waitFor(); + if (exitCode != 0) { + String output; + try (var in = process.getInputStream()) { + output = new String(in.readAllBytes(), StandardCharsets.UTF_8); + } + throw new AssertionError("icacls failed with exit code " + exitCode + ": " + output); + } } catch (IOException | InterruptedException e) { throw new AssertionError(e);