You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rm...@apache.org on 2019/08/14 07:50:00 UTC
[maven-shade-plugin] branch MSHADE-322_2 updated (646c2c3 ->
e300c04)
This is an automated email from the ASF dual-hosted git repository.
rmannibucau pushed a change to branch MSHADE-322_2
in repository https://gitbox.apache.org/repos/asf/maven-shade-plugin.git.
from 646c2c3 extracting SortedProperties to be able to reuse it in the test validating properties keys stability + fixing related test
add 2682f6e [MSHADE-306] - log all duplicates to not silently swallow a duplicate and an implicit selection
new 0db53c7 Merge branch 'log-all-duplicates' into MSHADE-322_2
new e300c04 fixing Tibor's review comments (thanks) and ensuring test works on windows
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.
Summary of changes:
.../apache/maven/plugins/shade/DefaultShader.java | 48 ++++++++++++---
.../resource/properties/SortedProperties.java | 9 ++-
.../maven/plugins/shade/DefaultShaderTest.java | 72 ++++++++++++++++++++++
3 files changed, 117 insertions(+), 12 deletions(-)
[maven-shade-plugin] 02/02: fixing Tibor's review comments (thanks)
and ensuring test works on windows
Posted by rm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rmannibucau pushed a commit to branch MSHADE-322_2
in repository https://gitbox.apache.org/repos/asf/maven-shade-plugin.git
commit e300c0438b401ebd977f7157f925f4b8a3f1caba
Author: Romain Manni-Bucau <rm...@apache.org>
AuthorDate: Wed Aug 14 09:49:45 2019 +0200
fixing Tibor's review comments (thanks) and ensuring test works on windows
---
.../plugins/shade/resource/properties/SortedProperties.java | 9 ++++++---
.../org/apache/maven/plugins/shade/DefaultShaderTest.java | 13 ++++++-------
2 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/src/main/java/org/apache/maven/plugins/shade/resource/properties/SortedProperties.java b/src/main/java/org/apache/maven/plugins/shade/resource/properties/SortedProperties.java
index 48eb5f0..f64f9f7 100644
--- a/src/main/java/org/apache/maven/plugins/shade/resource/properties/SortedProperties.java
+++ b/src/main/java/org/apache/maven/plugins/shade/resource/properties/SortedProperties.java
@@ -23,8 +23,8 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Enumeration;
-import java.util.HashSet;
import java.util.Iterator;
+import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -32,7 +32,10 @@ import java.util.Properties;
import java.util.Set;
/**
- * Properties instance sorting its keys on iterations.
+ * Internal Properties instance sorting its keys on iterations for store() usages.
+ * It ensures properties persistence is deterministic.
+ *
+ * IMPORTANT: this only overrides methods used accross JVM in store() so ordering is not guaranteed for other cases.
*/
public class SortedProperties extends Properties
{
@@ -48,7 +51,7 @@ public class SortedProperties extends Properties
return String.valueOf( o1.getKey() ).compareTo( String.valueOf( o2.getKey() ) );
}
} );
- return new HashSet<>( entries );
+ return new LinkedHashSet<>( entries );
}
@Override
diff --git a/src/test/java/org/apache/maven/plugins/shade/DefaultShaderTest.java b/src/test/java/org/apache/maven/plugins/shade/DefaultShaderTest.java
index 54be8dd..e736d6a 100644
--- a/src/test/java/org/apache/maven/plugins/shade/DefaultShaderTest.java
+++ b/src/test/java/org/apache/maven/plugins/shade/DefaultShaderTest.java
@@ -65,7 +65,7 @@ public class DefaultShaderTest
@Override
public void debug( final String s, final Throwable throwable )
{
- debugMessages.add(s);
+ debugMessages.add( s.replace( '\\', '/' ).trim() );
}
@Override
@@ -77,7 +77,7 @@ public class DefaultShaderTest
@Override
public void warn( final String s, final Throwable throwable )
{
- warnMessages.add(s);
+ warnMessages.add( s.replace( '\\', '/' ).trim() );
}
@Override
@@ -101,7 +101,7 @@ public class DefaultShaderTest
// we will shade two jars and expect to see META-INF/MANIFEST.MF overlaps, this will always be true
// but this can lead to a broken deployment if intended for OSGi or so, so even this should be logged
- final Set<File> set = new LinkedHashSet<File>();
+ final Set<File> set = new LinkedHashSet<>();
set.add( new File( "src/test/jars/test-project-1.0-SNAPSHOT.jar" ) );
set.add( new File( "src/test/jars/plexus-utils-1.4.1.jar" ) );
@@ -115,13 +115,12 @@ public class DefaultShaderTest
final String failureWarnMessage = warnMessages.toString();
assertTrue(failureWarnMessage, warnMessages.contains(
- "plexus-utils-1.4.1.jar, test-project-1.0-SNAPSHOT.jar define 1 overlapping resources: "));
- assertTrue(failureWarnMessage, warnMessages.contains(" - META-INF/MANIFEST.MF"));
+ "plexus-utils-1.4.1.jar, test-project-1.0-SNAPSHOT.jar define 1 overlapping resources:"));
+ assertTrue(failureWarnMessage, warnMessages.contains("- META-INF/MANIFEST.MF"));
final String failureDebugMessage = debugMessages.toString();
assertTrue(failureDebugMessage, debugMessages.contains(
- "We have a duplicate META-INF/MANIFEST.MF in src/test/jars/plexus-utils-1.4.1.jar"
- .replace('/', File.separatorChar)));
+ "We have a duplicate META-INF/MANIFEST.MF in src/test/jars/plexus-utils-1.4.1.jar" ));
}
public void testShaderWithDefaultShadedPattern()
[maven-shade-plugin] 01/02: Merge branch 'log-all-duplicates' into
MSHADE-322_2
Posted by rm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rmannibucau pushed a commit to branch MSHADE-322_2
in repository https://gitbox.apache.org/repos/asf/maven-shade-plugin.git
commit 0db53c7705caee71575cf629cf6baefcc0efc863
Merge: 646c2c3 2682f6e
Author: Romain Manni-Bucau <rm...@apache.org>
AuthorDate: Wed Aug 14 09:45:08 2019 +0200
Merge branch 'log-all-duplicates' into MSHADE-322_2
.../apache/maven/plugins/shade/DefaultShader.java | 48 +++++++++++---
.../maven/plugins/shade/DefaultShaderTest.java | 73 ++++++++++++++++++++++
2 files changed, 112 insertions(+), 9 deletions(-)