Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sort maven dependencies in Eclipse

Just wanted to know if it is possible in Eclipse to sort Maven dependencies by alphabetical order?

It's bothering me to have a list of 200 jars not ordered... :(

like image 358
Sebastien Lorber Avatar asked Sep 28 '10 12:09

Sebastien Lorber


People also ask

How do I view project dependencies in eclipse?

Right-click the project, then select "Properties", then "Java Build Path". The tabs "Projects" and "Libraries" list what the project depends on. Note that the "Order and Export" tab alllows you to have indirect dependencies.

Does order matter in Maven dependency?

The order of dependencies does matter because of how Maven resolves transitive dependencies, starting with version 2.0.


2 Answers

Finally it is possible with Eclipse Photon now.

Just tick the checkbox Sort library entries alphabetically in Package Explorer under PreferencesJavaAppearance

See also here under 'Sort library entries alphabetically in Package Explorer'.

Unfortunately theres a bug, at least for me, that the source folders are also reordered, see here.

preferences

like image 62
Andreas Schaller Avatar answered Oct 14 '22 12:10

Andreas Schaller


I guess you refer to the m2eclipse plugin. You have these options:

  1. The order in the navigator is the classpath order. You can sort the dependencies in the POM to get a better list. Of course, there is a problem with transient dependencies.

  2. You can open the POM file in the POM editor and examine the dependencies in the tab "Dependency Hierarchy"

  3. You can type part of the name of a dependency to locate it when the tree item "Maven Dependencies" is open.

like image 41
Aaron Digulla Avatar answered Oct 14 '22 12:10

Aaron Digulla