Description
When this maven issue was fixed in maven 2.0.9 the java.util.LinkedHashSet
was used instead of the java.util.HashSet
. When the spring-boot-maven-plugin performs the repackage goal using the AbstractDependencyFilterMojo.filterDependencies
method the org.apache.maven.shared.artifact.filter.collection.FilterArtifacts.filter
method will be called and will try to apply all of the filters in its filters ArrayList fields. In my particular case, the ArrayList contained 4 entries which were:
org.springframework.boot.maven.ExcludeFilter
org.apache.maven.shared.artifact.filter.collection.ScopeFilter
org.apache.maven.shared.artifact.filter.collection.ArtifactIdFilter
org.springframework.boot.maven.MatchingGroupIdFilter
They are all using HashSet
instead of LinkedHashSet
. This breaks the POM order for libraries and should be fixed. It looks like two are in the Spring Boot maven plugin which should be easy to fix but the others would require maven source changes. I do not know what other filters could be used over and above the 4 were in my case but they would also need to be changed.
Fixing this bug will give users some control of the classpath ordering when launching a jar file.