Programing

Eclipse에서 Maven 종속성 정렬

crosscheck 2020. 11. 12. 07:55
반응형

Eclipse에서 Maven 종속성 정렬


Eclipse에서 Maven 종속성을 알파벳순으로 정렬 할 수 있는지 알고 싶습니까?

주문되지 않은 200 개의 항아리 목록이 있다는 것이 귀찮습니다 ... :(


마지막으로 Eclipse Photon으로 가능합니다.

Preferences-> Java-> Appearance에서 '패키지 탐색기에서 라이브러리 항목을 알파벳순으로 정렬'확인란을 선택하십시오.

참조 여기에 '순으로 패키지 탐색기에서 정렬 라이브러리 항목'에서.

불행히도 적어도 저에게는 소스 폴더도 재정렬된다는 버그가 있습니다 . 여기를 참조 하십시오 .


나는 당신이 m2eclipse 플러그인을 참조한다고 생각합니다. 다음과 같은 옵션이 있습니다.

  1. 네비게이터의 순서는 클래스 경로 순서입니다. POM에서 종속성을 정렬하여 더 나은 목록을 얻을 수 있습니다. 물론 일시적인 종속성에 문제가 있습니다.

  2. POM 편집기에서 POM 파일을 열고 "종속성 계층"탭에서 종속성을 검사 할 수 있습니다.

  3. "Maven Dependencies"트리 항목이 열려있을 때 종속성 이름의 일부를 입력하여 찾을 수 있습니다.


Maven의 Pom 뷰어가 트릭을 수행합니다.

관심있는 항목을 두 번 클릭합니다 pom.xml. Eclipse는 하단에 개요, 종속성, 종속성 계층, 유효 POM 및 pom.xml의 5 개 탭이있는 특수 뷰어에서 열립니다.

를 클릭하십시오 Dependency Hierarchy. 보기 오른쪽에 다음이 표시되어야합니다.

여기에 이미지 설명 입력

알파벳순입니다.


I just ran into the Sortpom Maven Plugin. This enables you to sort the dependencies in your pom using a Maven command. So you can use it in Eclipse, but also in any other IDE (I'm using NetBeans where you can configure it as custom goal definition).

Simply run:

mvn com.github.ekryd.sortpom:sortpom-maven-plugin:sort -Dsort.sortDependencies=groupId,artifactId

At the GitHub wiki you can find all parameters.

But as pointed out in the comments, sorting like this isn't a good idea. Let your IDE take care of it. NetBeans has a "Dependencies" folder in a project where the dependencies are shown sorted by default (first by type, then by name).


have a look at the project properties in the 'java build path' section under the 'libraries' tab.

i don't know for sure if this works for the m2eclipse plugin.

참고 URL : https://stackoverflow.com/questions/3812894/sort-maven-dependencies-in-eclipse

반응형