Skip to content
This repository was archived by the owner on Dec 4, 2024. It is now read-only.

Commit 03349df

Browse files
committed
sort manually crafted descriptors files for reproducible builds
this closes #27
1 parent a14f3ac commit 03349df

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/DefaultMetadataGenerator.java

+9
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,15 @@ public int compare( ComponentDescriptor d1, ComponentDescriptor d2 )
149149
{
150150
File[] files = request.componentDescriptorDirectory.listFiles();
151151

152+
// Sort the files by name to make the output reproducible
153+
Arrays.sort( files, new Comparator<File>()
154+
{
155+
public int compare( File f1, File f2 )
156+
{
157+
return f1.getName().compareTo( f2.getName() );
158+
}
159+
});
160+
152161
int added = 0;
153162
for ( File file : files )
154163
{

0 commit comments

Comments
 (0)