diff --git a/src/main/java/org/apache/maven/plugins/shade/resource/ApacheNoticeResourceTransformer.java b/src/main/java/org/apache/maven/plugins/shade/resource/ApacheNoticeResourceTransformer.java index 4b31d329..a850a3a2 100644 --- a/src/main/java/org/apache/maven/plugins/shade/resource/ApacheNoticeResourceTransformer.java +++ b/src/main/java/org/apache/maven/plugins/shade/resource/ApacheNoticeResourceTransformer.java @@ -36,7 +36,6 @@ import java.util.jar.JarOutputStream; import org.apache.maven.plugins.shade.relocation.Relocator; -import org.codehaus.plexus.util.StringUtils; /** * Merges META-INF/NOTICE.TXT files. @@ -106,7 +105,7 @@ public void processResource(String resource, InputStream is, List rel } BufferedReader reader; - if (StringUtils.isNotEmpty(encoding)) { + if (encoding != null && !encoding.isEmpty()) { reader = new BufferedReader(new InputStreamReader(is, encoding)); } else { reader = new BufferedReader(new InputStreamReader(is)); @@ -178,7 +177,7 @@ public void modifyOutputStream(JarOutputStream jos) throws IOException { jos.putNextEntry(jarEntry); Writer writer; - if (StringUtils.isNotEmpty(encoding)) { + if (encoding != null && !encoding.isEmpty()) { writer = new OutputStreamWriter(jos, encoding); } else { writer = new OutputStreamWriter(jos); diff --git a/src/main/java/org/apache/maven/plugins/shade/resource/DontIncludeResourceTransformer.java b/src/main/java/org/apache/maven/plugins/shade/resource/DontIncludeResourceTransformer.java index 406171e8..0be64dfd 100644 --- a/src/main/java/org/apache/maven/plugins/shade/resource/DontIncludeResourceTransformer.java +++ b/src/main/java/org/apache/maven/plugins/shade/resource/DontIncludeResourceTransformer.java @@ -24,7 +24,6 @@ import java.util.jar.JarOutputStream; import org.apache.maven.plugins.shade.relocation.Relocator; -import org.codehaus.plexus.util.StringUtils; /** * A resource processor that prevents the inclusion of an arbitrary @@ -36,7 +35,7 @@ public class DontIncludeResourceTransformer extends AbstractCompatibilityTransfo List resources; public boolean canTransformResource(String r) { - if (StringUtils.isNotEmpty(resource) && r.endsWith(resource)) { + if ((resource != null && !resource.isEmpty()) && r.endsWith(resource)) { return true; }