File: 0005-reproducible-metadata.patch

package info (click to toggle)
plexus-maven-plugin 1.3.8-10
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 372 kB
  • ctags: 294
  • sloc: java: 1,081; xml: 283; sh: 11; makefile: 4
file content (19 lines) | stat: -rw-r--r-- 902 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Description: Sort the components to make the metadata reproducible
Author: Emmanuel Bourg <ebourg@apache.org>
Forwarded: no

--- a/src/main/java/org/codehaus/plexus/maven/plugin/AbstractDescriptorMojo.java
+++ b/src/main/java/org/codehaus/plexus/maven/plugin/AbstractDescriptorMojo.java
@@ -144,6 +144,12 @@
         else {
             getLog().info("Discovered " + descriptors.size() + " component descriptors(s)");
 
+            Collections.sort(descriptors, new java.util.Comparator<ComponentDescriptor>() {
+                public int compare(ComponentDescriptor d1, ComponentDescriptor d2) {
+                    return d1.getHumanReadableKey().compareTo(d2.getHumanReadableKey());
+                }
+            });
+
             ComponentSetDescriptor set = new ComponentSetDescriptor();
             set.setComponents(descriptors);
             set.setDependencies(Collections.EMPTY_LIST);