You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by bm...@apache.org on 2020/12/06 10:03:26 UTC
[maven-jlink-plugin] branch master updated: [MJLINK-58] Remove
usage of plexus utils, use commons lang or native java instead.
This is an automated email from the ASF dual-hosted git repository.
bmarwell pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-jlink-plugin.git
The following commit(s) were added to refs/heads/master by this push:
new 24f2bf8 [MJLINK-58] Remove usage of plexus utils, use commons lang or native java instead.
24f2bf8 is described below
commit 24f2bf8d10df37696f5901f4353e2ef1bd3fdd0b
Author: Benjamin Marwell <bm...@apache.org>
AuthorDate: Sun Dec 6 11:02:48 2020 +0100
[MJLINK-58] Remove usage of plexus utils, use commons lang or native java instead.
- replace org.codehaus.plexus.util.StringUtils by org.apache.commons.lang3.StringUtils
- replace org.codehaus.plexus.util.FileUtils by org.apache.commons.io.FileUtils
- make transitive dep commons-io explicit
Signed-off-by: Benjamin Marwell <bm...@apache.org>
---
pom.xml | 5 +++++
.../apache/maven/plugins/jlink/AbstractJLinkToolchainExecutor.java | 4 ++--
src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java | 2 +-
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/pom.xml b/pom.xml
index 45e7acc..659db20 100644
--- a/pom.xml
+++ b/pom.xml
@@ -110,6 +110,11 @@
<version>3.6</version>
</dependency>
<dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.8.0</version>
+ </dependency>
+ <dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.5.13</version>
diff --git a/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkToolchainExecutor.java b/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkToolchainExecutor.java
index a38a9c7..3ebce69 100644
--- a/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkToolchainExecutor.java
+++ b/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkToolchainExecutor.java
@@ -19,6 +19,7 @@ package org.apache.maven.plugins.jlink;
* under the License.
*/
+import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.SystemUtils;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.logging.Log;
@@ -26,7 +27,6 @@ import org.apache.maven.shared.utils.cli.CommandLineException;
import org.apache.maven.shared.utils.cli.CommandLineUtils;
import org.apache.maven.shared.utils.cli.Commandline;
import org.apache.maven.toolchain.Toolchain;
-import org.codehaus.plexus.util.StringUtils;
import java.io.File;
import java.util.List;
@@ -114,7 +114,7 @@ abstract class AbstractJLinkToolchainExecutor extends AbstractJLinkExecutor
String jLinkExecutable = toolchain.orElseThrow( NoSuchElementException::new ).findTool( "jlink" );
- if ( StringUtils.isEmpty( jLinkExecutable ) )
+ if ( jLinkExecutable.isEmpty() )
{
throw new IllegalStateException( "The jlink executable '"
+ jLinkExecutable + "' doesn't exist or is not a file." );
diff --git a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
index 3256565..3e7a63a 100644
--- a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
+++ b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
@@ -31,6 +31,7 @@ import java.util.Map.Entry;
import java.util.NoSuchElementException;
import java.util.Optional;
+import org.apache.commons.io.FileUtils;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
@@ -49,7 +50,6 @@ import org.codehaus.plexus.languages.java.jpms.JavaModuleDescriptor;
import org.codehaus.plexus.languages.java.jpms.LocationManager;
import org.codehaus.plexus.languages.java.jpms.ResolvePathsRequest;
import org.codehaus.plexus.languages.java.jpms.ResolvePathsResult;
-import org.codehaus.plexus.util.FileUtils;
/**
* The JLink goal is intended to create a Java Run Time Image file based on