Maven 2.x Dependency Plugin

Dependency sort mojo

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Won't Fix
  • Affects Version/s: 2.0-alpha-4
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Patch Submitted:
    Yes
  • Number of attachments :
    2

Description

I have a few projects that have a large number of dependencies. I would like to be able to sort them into alphabetical order for easier readability. Also sometimes the same dependency gets copied and pasted and there is a duplicate. I created the sort mojo to sort dependencies in alphabetical order and optionally remove duplicates and group the dependencies by their scope.

Issue Links

Activity

Hide
Brian Fox added a comment -

Interesting. Can you include some unit tests and site docs?

Show
Brian Fox added a comment - Interesting. Can you include some unit tests and site docs?
Hide
Paul Gier added a comment -

Here is a new patch with test and docs, and a couple improvements thanks to the tests

Show
Paul Gier added a comment - Here is a new patch with test and docs, and a couple improvements thanks to the tests
Hide
Paul Gier added a comment -

Any chance this can go into alpha 5 ?

Show
Paul Gier added a comment - Any chance this can go into alpha 5 ?
Hide
Mark Hobson added a comment -

Doesn't dependency:resolve / dependency:list already sort the dependencies alphabetically?

Show
Mark Hobson added a comment - Doesn't dependency:resolve / dependency:list already sort the dependencies alphabetically?
Hide
Paul Gier added a comment -

They do sort, but those goals don't give you a format that you can put back into your pom.
This mojo is meant to help make the pom more readable.

Show
Paul Gier added a comment - They do sort, but those goals don't give you a format that you can put back into your pom. This mojo is meant to help make the pom more readable.
Hide
Mark Hobson added a comment -

Ah right, I see. Perhaps a general purpose POM formatter goal would be better? It could utilise Maven's model readers and writers to give a consistent output.

Show
Mark Hobson added a comment - Ah right, I see. Perhaps a general purpose POM formatter goal would be better? It could utilise Maven's model readers and writers to give a consistent output.
Hide
Paul Gier added a comment -

Yeah, a new pom formatting plugin would probably be useful, and a good place for this goal to go. I just didn't want to spend too much time on this. I wrote this mojo just so I didn't have to clean up a few of my pom dependencies by hand.

Show
Paul Gier added a comment - Yeah, a new pom formatting plugin would probably be useful, and a good place for this goal to go. I just didn't want to spend too much time on this. I wrote this mojo just so I didn't have to clean up a few of my pom dependencies by hand.
Hide
Mark Hobson added a comment -

Could be worth proposing on mojo-dev and see what people think before incorporating this into the dependency plugin.

Show
Mark Hobson added a comment - Could be worth proposing on mojo-dev and see what people think before incorporating this into the dependency plugin.
Hide
Paul Gier added a comment -

Ok, I made it into a stand alone plugin. I'm thinking that there could be a generic plugin for reading, analyzing, and writing poms.
I noticed that there is a maven-pom-plugin for maven 1, but I didn't see one for maven 2, so I thought that might be a good name.

Show
Paul Gier added a comment - Ok, I made it into a stand alone plugin. I'm thinking that there could be a generic plugin for reading, analyzing, and writing poms. I noticed that there is a maven-pom-plugin for maven 1, but I didn't see one for maven 2, so I thought that might be a good name.
Hide
Paul Gier added a comment -

Closing this issue since the patch has been submitted as a new mojo.

Show
Paul Gier added a comment - Closing this issue since the patch has been submitted as a new mojo.

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: