You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by el...@apache.org on 2023/06/01 11:21:18 UTC

[maven-shared-utils] branch interp created (now 14c168b)

This is an automated email from the ASF dual-hosted git repository.

elharo pushed a change to branch interp
in repository https://gitbox.apache.org/repos/asf/maven-shared-utils.git


      at 14c168b  remove last dependency on plexus

This branch includes the following new commits:

     new 31c41f5  spotless
     new 14c168b  remove last dependency on plexus

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[maven-shared-utils] 02/02: remove last dependency on plexus

Posted by el...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

elharo pushed a commit to branch interp
in repository https://gitbox.apache.org/repos/asf/maven-shared-utils.git

commit 14c168b4495af7b14c6ac6f5143512b44fcc8fb6
Author: Elliotte Rusty Harold <el...@ibiblio.org>
AuthorDate: Thu Jun 1 07:21:06 2023 -0400

    remove last dependency on plexus
---
 src/test/java/org/apache/maven/shared/utils/io/FileUtilsTest.java | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/test/java/org/apache/maven/shared/utils/io/FileUtilsTest.java b/src/test/java/org/apache/maven/shared/utils/io/FileUtilsTest.java
index da1eadf..946e74a 100644
--- a/src/test/java/org/apache/maven/shared/utils/io/FileUtilsTest.java
+++ b/src/test/java/org/apache/maven/shared/utils/io/FileUtilsTest.java
@@ -36,10 +36,8 @@ import java.io.Writer;
 import java.net.URL;
 import java.nio.file.Files;
 import java.util.Arrays;
-import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
-import java.util.Map;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.commons.io.IOUtils;


[maven-shared-utils] 01/02: spotless

Posted by el...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

elharo pushed a commit to branch interp
in repository https://gitbox.apache.org/repos/asf/maven-shared-utils.git

commit 31c41f5256733bbe79519f093e8b485d701d40fb
Author: Elliotte Rusty Harold <el...@ibiblio.org>
AuthorDate: Thu Jun 1 07:20:44 2023 -0400

    spotless
---
 pom.xml                                                |  6 ------
 .../apache/maven/shared/utils/io/FileUtilsTest.java    | 18 ++++++++----------
 2 files changed, 8 insertions(+), 16 deletions(-)

diff --git a/pom.xml b/pom.xml
index e513050..5f937ff 100644
--- a/pom.xml
+++ b/pom.xml
@@ -120,12 +120,6 @@
       <version>3.0.2</version>
       <scope>provided</scope>
     </dependency>
-    <dependency>
-      <groupId>org.codehaus.plexus</groupId>
-      <artifactId>plexus-utils</artifactId>
-      <version>3.5.1</version>
-      <scope>test</scope>
-    </dependency>
   </dependencies>
 
   <build>
diff --git a/src/test/java/org/apache/maven/shared/utils/io/FileUtilsTest.java b/src/test/java/org/apache/maven/shared/utils/io/FileUtilsTest.java
index efd49a9..da1eadf 100644
--- a/src/test/java/org/apache/maven/shared/utils/io/FileUtilsTest.java
+++ b/src/test/java/org/apache/maven/shared/utils/io/FileUtilsTest.java
@@ -31,6 +31,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.Reader;
+import java.io.StringReader;
 import java.io.Writer;
 import java.net.URL;
 import java.nio.file.Files;
@@ -44,7 +45,6 @@ import java.util.concurrent.TimeUnit;
 import org.apache.commons.io.IOUtils;
 import org.apache.maven.shared.utils.Os;
 import org.apache.maven.shared.utils.testhelpers.FileTestHelper;
-import org.codehaus.plexus.util.InterpolationFilterReader;
 import org.hamcrest.CoreMatchers;
 import org.junit.Before;
 import org.junit.Ignore;
@@ -444,7 +444,7 @@ public class FileUtilsTest {
         File from = write("from.txt", MODIFIED_YESTERDAY, "Hello ${name}!");
         File to = new File(tempFolder.getRoot(), "to.txt");
 
-        FileUtils.copyFile(from, to, null, wrappers("name", "Bob"));
+        FileUtils.copyFile(from, to, null, wrappers());
 
         assertTrue("to.txt did not exist so should have been written", to.lastModified() >= MODIFIED_TODAY);
         assertFileContent(to, "Hello Bob!");
@@ -455,7 +455,7 @@ public class FileUtilsTest {
         File from = write("from.txt", MODIFIED_YESTERDAY, "Hello ${name}!");
         File to = write("to.txt", MODIFIED_LAST_WEEK, "Older content");
 
-        FileUtils.copyFile(from, to, null, wrappers("name", "Bob"));
+        FileUtils.copyFile(from, to, null, wrappers());
 
         assertTrue("to.txt was outdated so should have been overwritten", to.lastModified() >= MODIFIED_TODAY);
         assertFileContent(to, "Hello Bob!");
@@ -466,7 +466,7 @@ public class FileUtilsTest {
         File from = write("from.txt", MODIFIED_LAST_WEEK, "Hello ${name}!");
         File to = write("to.txt", MODIFIED_YESTERDAY, "Older content");
 
-        FileUtils.copyFile(from, to, null, wrappers("name", "Bob"), true);
+        FileUtils.copyFile(from, to, null, wrappers(), true);
 
         assertTrue("to.txt was newer but the overwrite should have been forced", to.lastModified() >= MODIFIED_TODAY);
         assertFileContent(to, "Hello Bob!");
@@ -477,7 +477,7 @@ public class FileUtilsTest {
         File from = write("from.txt", MODIFIED_LAST_WEEK, "Hello ${name}!");
         File to = write("to.txt", MODIFIED_YESTERDAY, "Hello Charlie!");
 
-        FileUtils.copyFile(from, to, null, wrappers("name", "Bob"));
+        FileUtils.copyFile(from, to, null, wrappers());
 
         assertTrue("to.txt was outdated so should have been overwritten", to.lastModified() >= MODIFIED_TODAY);
         assertFileContent(to, "Hello Bob!");
@@ -488,20 +488,18 @@ public class FileUtilsTest {
         File from = write("from.txt", MODIFIED_LAST_WEEK, "Hello ${name}!");
         File to = write("to.txt", MODIFIED_YESTERDAY, "Hello Bob!");
 
-        FileUtils.copyFile(from, to, null, wrappers("name", "Bob"));
+        FileUtils.copyFile(from, to, null, wrappers());
 
         assertFileContent(to, "Hello Bob!");
         assertTrue("to.txt content should be unchanged and have been left alone", to.lastModified() < MODIFIED_TODAY);
     }
 
-    private static FileUtils.FilterWrapper[] wrappers(String key, String value) {
-        final Map<String, Object> map = new HashMap<>();
-        map.put(key, value);
+    private static FileUtils.FilterWrapper[] wrappers() {
         return new FileUtils.FilterWrapper[] {
             new FileUtils.FilterWrapper() {
                 @Override
                 public Reader getReader(Reader reader) {
-                    return new InterpolationFilterReader(reader, map);
+                    return new StringReader("Hello Bob!");
                 }
             }
         };