Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
marioja opened this issue Feb 24, 2017 · 10 comments
Assignees
Labels
type: bug A general bug
Milestone

Comments

@marioja
Copy link

marioja commented Feb 24, 2017

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.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 24, 2017
@marioja
Copy link
Author

marioja commented Feb 26, 2017

Any update when this could be triaged? Thanks

@philwebb philwebb added priority: normal type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Feb 28, 2017
@philwebb philwebb added this to the 1.5.2 milestone Feb 28, 2017
@philwebb
Copy link
Member

One option might be to do the filtering on a new set, then use that to remove items from the original set.

@marioja
Copy link
Author

marioja commented Feb 28, 2017

Are you commenting on how to fix it or how to work around?

@philwebb
Copy link
Member

philwebb commented Feb 28, 2017

Just a note to myself or whoever picks it up that we might be able to fix it without changing those Maven plugins. We'll need to change the code for sure, I can't see a way to work around the issue without that.

@snicoll snicoll self-assigned this Mar 1, 2017
@snicoll snicoll closed this as completed in 19b4833 Mar 1, 2017
@snicoll
Copy link
Member

snicoll commented Mar 1, 2017

@marioja this is going to be available in the next 1.5.2.BUILD-SNAPSHOT. If you can give it a try and report back that would be great!

@marioja
Copy link
Author

marioja commented Mar 1, 2017 via email

@snicoll
Copy link
Member

snicoll commented Mar 1, 2017

I am not following. Just use Spring Boot 1.5.2.BUILD-SNAPSHOT instead of 1.5.1.RELEASE. You can create a project on start.spring.io if you don't know how to get the bits. But wait that the build completes first (we've had a glitch on the 1.5.x branch this morning so the snapshot hasn't been updated yet).

@marioja
Copy link
Author

marioja commented Mar 1, 2017

My bad, what I meant was do I get this snapshot from Maven Central or do I need special POM configuration to get this snapshot? How do I know when and if the snapshot ran?

@marioja
Copy link
Author

marioja commented Mar 1, 2017

Ok, a little of Googling told me that the snapshot repository lives at this location. Is there a fail proof way of discovering this? In my POM, I specify the snapshot repository in the distribution management section but I could not find it in the Spring Boot pom.

@snicoll
Copy link
Member

snicoll commented Mar 1, 2017

@marioja I already replied you and http://projects.spring.io/spring-boot/ has more info. If you're still confused, please join us on gitter and let's chat there rather than adding noise here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

4 participants