Skip to content
Snippets Groups Projects
Commit 42820362 authored by Thomas Mortagne's avatar Thomas Mortagne
Browse files

XWIKI-13147: Package plugin import mojo does not keep dependency order

parent cf914d78
No related merge requests found
......@@ -22,7 +22,7 @@
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
......@@ -173,7 +173,7 @@ private void importDependencies(Importer importer, String databaseName, File hib
// We have to create our own Set because Maven changes the fields from the dependency Artifacts (e.g. resolves
// their version) after they are added to the Set of dependencies and this causes the hash code to change. As a
// result the #contains(Artifact) method doesn't work as expected because it uses the new hash code.
Set<Artifact> directDependencies = new HashSet<>(this.project.getDependencyArtifacts());
Set<Artifact> directDependencies = new LinkedHashSet<>(this.project.getDependencyArtifacts());
// Reverse artifact order to have dependencies first (despite the fact that it's a Set it's actually an ordered
// LinkedHashSet behind the scene)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment