Ekryd / sortpom

Maven plugin that helps the user sort pom.xml.
https://github.com/Ekryd/sortpom/wiki/
BSD 3-Clause "New" or "Revised" License
334 stars 178 forks source link

Predefined sort order for groupId of dependencies #443

Closed apolit closed 4 days ago

apolit commented 4 weeks ago

It will be nice to be able to define which groups are prioritized. So that internal company artifacts, or e.g. framework artifacts, can go first. So that they will take precedence in resolving artifacts versions.

Something like: <groupIdSortOrder>com.acme.*,org.springframework.*,others</groupIdSortOrder>

Ekryd commented 3 weeks ago

It is possible to create your own predefinedSortOrder. Any dependency that you directly specify in that file will be pushed towards the top of the dependency list. I would start by copying any from https://github.com/Ekryd/sortpom/tree/master/sorter/src/main/resources and then experiment some.

Next question is why you would sort select dependencies first. Either you have some nasty dependencies that that demand that you have a certain sort order - and then you shouldn't sort your dependencies, or else it doesn't matter which comes first. Placing dependencies first for aesthetics is not the major goal of the plugin 😉