Skip to content

When the spring-boot-maven-plugin performs the repackage goal the POM order of the libraries is not maintained #8397

Closed
@marioja

Description

@marioja

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:

  1. org.springframework.boot.maven.ExcludeFilter
  2. org.apache.maven.shared.artifact.filter.collection.ScopeFilter
  3. org.apache.maven.shared.artifact.filter.collection.ArtifactIdFilter
  4. 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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions