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 2020/07/27 16:58:42 UTC
[maven-resources-plugin] branch master updated: future proof method
that is marked for incompatible change (#6)
This is an automated email from the ASF dual-hosted git repository.
elharo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-resources-plugin.git
The following commit(s) were added to refs/heads/master by this push:
new 6624e45 future proof method that is marked for incompatible change (#6)
6624e45 is described below
commit 6624e45411b02b1c31694042e9b5f9b386422904
Author: Elliotte Rusty Harold <el...@users.noreply.github.com>
AuthorDate: Mon Jul 27 16:58:35 2020 +0000
future proof method that is marked for incompatible change (#6)
* future proof method that is marked for incompatible change
* remove compile time dependency on plexus-utils
* declare aether
* declare sisu
* remove Latin
* add assert
---
pom.xml | 38 +++++++++++++++++-----
src/it/MRESOURCES-257/verify.groovy | 1 +
.../maven/plugins/resources/ResourcesMojo.java | 13 ++++----
3 files changed, 36 insertions(+), 16 deletions(-)
diff --git a/pom.xml b/pom.xml
index dce6def..d30f965 100644
--- a/pom.xml
+++ b/pom.xml
@@ -97,19 +97,26 @@ under the License.
<artifactId>maven-model</artifactId>
<version>${mavenVersion}</version>
</dependency>
-
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<scope>provided</scope>
</dependency>
-
<dependency>
<groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-utils</artifactId>
- <version>3.3.0</version>
+ <artifactId>plexus-component-annotations</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-interpolation</artifactId>
+ <version>1.26</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.sisu</groupId>
+ <artifactId>org.eclipse.sisu.plexus</artifactId>
+ <version>0.0.0.M2a</version>
</dependency>
-
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-filtering</artifactId>
@@ -122,11 +129,11 @@ under the License.
<version>2.6</version>
<scope>compile</scope>
</dependency>
-
<dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-interpolation</artifactId>
- <version>1.26</version>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <version>3.8.1</version>
+ <scope>compile</scope>
</dependency>
<dependency>
@@ -147,6 +154,19 @@ under the License.
<version>4.13</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-utils</artifactId>
+ <version>3.3.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.aether</groupId>
+ <artifactId>aether-api</artifactId>
+ <version>0.9.0.M2</version>
+ <scope>test</scope>
+ </dependency>
+
</dependencies>
<profiles>
diff --git a/src/it/MRESOURCES-257/verify.groovy b/src/it/MRESOURCES-257/verify.groovy
index dab0203..6f88c82 100644
--- a/src/it/MRESOURCES-257/verify.groovy
+++ b/src/it/MRESOURCES-257/verify.groovy
@@ -20,4 +20,5 @@ assert new File(basedir, 'target/classes/test.txt').exists();
content = new File(basedir, 'target/classes/test.txt').text;
assert content.contains( 'jdoe@example.com' );
+assert content.contains( 'orga' );
return true;
diff --git a/src/main/java/org/apache/maven/plugins/resources/ResourcesMojo.java b/src/main/java/org/apache/maven/plugins/resources/ResourcesMojo.java
index 9fbbe35..a350a44 100644
--- a/src/main/java/org/apache/maven/plugins/resources/ResourcesMojo.java
+++ b/src/main/java/org/apache/maven/plugins/resources/ResourcesMojo.java
@@ -27,6 +27,7 @@ import java.util.LinkedHashSet;
import java.util.List;
import java.util.Properties;
+import org.apache.commons.lang3.StringUtils;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.model.Resource;
import org.apache.maven.plugin.AbstractMojo;
@@ -45,8 +46,6 @@ import org.codehaus.plexus.component.repository.exception.ComponentLookupExcepti
import org.codehaus.plexus.context.Context;
import org.codehaus.plexus.context.ContextException;
import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
-import org.codehaus.plexus.util.ReaderFactory;
-import org.codehaus.plexus.util.StringUtils;
/**
* Copy resources for the main source code to the main output directory. Always uses the project.build.resources element
@@ -311,16 +310,16 @@ public class ResourcesMojo
return;
}
- if ( StringUtils.isEmpty( encoding ) && isFilteringEnabled( getResources() ) )
+ if ( StringUtils.isBlank( encoding ) && isFilteringEnabled( getResources() ) )
{
- getLog().warn( "File encoding has not been set, using platform encoding " + ReaderFactory.FILE_ENCODING
- + ", i.e. build is platform dependent!" );
- getLog().warn( "Please take a look into the FAQ: https://maven.apache.org/general.html#encoding-warning" );
+ getLog().warn( "File encoding has not been set, using platform encoding "
+ + System.getProperty( "file.encoding" )
+ + ". Build is platform dependent!" );
+ getLog().warn( "See https://maven.apache.org/general.html#encoding-warning" );
}
try
{
-
List<String> combinedFilters = getCombinedFiltersList();
MavenResourcesExecution mavenResourcesExecution =