This is an automated email from the ASF dual-hosted git repository. slachiewicz pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/maven-jdeps-plugin.git
commit 08327a81fe3f03ea0a739889c7e4f080edd7a385 Author: Sylwester Lachiewicz <[email protected]> AuthorDate: Tue Nov 17 06:47:42 2026 +0000 Replace remaining StringUtils and Commons calls with the JDK --- .../org/apache/maven/plugins/jdeps/AbstractJDepsMojo.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/apache/maven/plugins/jdeps/AbstractJDepsMojo.java b/src/main/java/org/apache/maven/plugins/jdeps/AbstractJDepsMojo.java index 2d39226..124d0e0 100644 --- a/src/main/java/org/apache/maven/plugins/jdeps/AbstractJDepsMojo.java +++ b/src/main/java/org/apache/maven/plugins/jdeps/AbstractJDepsMojo.java @@ -488,7 +488,7 @@ public abstract class AbstractJDepsMojo extends AbstractMojo { File jdepsExe; - if (StringUtils.isNotEmpty(jdepsExecutable)) { + if (jdepsExecutable != null && !jdepsExecutable.isEmpty()) { jdepsExe = new File(jdepsExecutable); if (jdepsExe.isDirectory()) { @@ -513,7 +513,7 @@ public abstract class AbstractJDepsMojo extends AbstractMojo { Properties env = CommandLineUtils.getSystemEnvVars(); if (!jdepsExe.exists() || !jdepsExe.isFile()) { String javaHome = env.getProperty("JAVA_HOME"); - if (!StringUtils.isEmpty(javaHome)) { + if (!(javaHome == null || javaHome.isEmpty())) { if ((!new File(javaHome).getCanonicalFile().exists()) || (new File(javaHome).getCanonicalFile().isFile())) { throw new IOException("The environment variable JAVA_HOME=" + javaHome @@ -589,18 +589,18 @@ public abstract class AbstractJDepsMojo extends AbstractMojo { try { int exitCode = CommandLineUtils.executeCommandLine(cmd, out, err); - String output = StringUtils.isEmpty(out.getOutput()) + String output = out.getOutput() == null || out.getOutput().isEmpty() ? null : '\n' + out.getOutput().trim(); if (exitCode != 0) { - if (StringUtils.isNotEmpty(output)) { + if (output != null && !output.isEmpty()) { getLog().info(output); } StringBuilder msg = new StringBuilder("\nExit code: "); msg.append(exitCode); - if (StringUtils.isNotEmpty(err.getOutput())) { + if (err.getOutput() != null && !err.getOutput().isEmpty()) { msg.append(" - ").append(err.getOutput()); } msg.append('\n'); @@ -609,7 +609,7 @@ public abstract class AbstractJDepsMojo extends AbstractMojo { throw new MojoExecutionException(msg.toString()); } - if (StringUtils.isNotEmpty(output)) { + if (output != null && !output.isEmpty()) { getLog().info(output); } } catch (CommandLineException e) { @@ -620,7 +620,7 @@ public abstract class AbstractJDepsMojo extends AbstractMojo { // Handle JDeps warnings // ---------------------------------------------------------------------- - if (StringUtils.isNotEmpty(err.getOutput()) && getLog().isWarnEnabled()) { + if ((err.getOutput() != null && !err.getOutput().isEmpty()) && getLog().isWarnEnabled()) { getLog().warn("JDeps Warnings"); StringTokenizer token = new StringTokenizer(err.getOutput(), "\n");
