developer tip

Eclipse : Maven 검색 종속성이 작동하지 않습니다.

optionbox 2020. 9. 5. 09:45
반응형

Eclipse : Maven 검색 종속성이 작동하지 않습니다.


새 작업 공간에 새로운 간단한 Maven 프로젝트를 만들었습니다.

나는 열 때 pom.xmlDependencies이클립스 편집기에서보기를하고, 내가 선택한 Add..의존성에 상관없이 검색 필드에 기준 I 입력을 검색 무슨 검색 결과가 없습니다 :

예를 들어 즉시 나에게 Results for 'spring' (0).

다른 작업 공간에서는 기존 프로젝트에이 문제가 없습니다.

그것을 고칠 방법이 있습니까?


Eclipse 아티팩트 검색은 저장소의 색인 파일에 따라 다릅니다. 색인 파일을 다운로드하지 않은 것 같습니다.

이동 > 메이븐 -> Prefrences - 창 및 확인 "시작에 저장소 인덱스 업데이트를 다운로드" . Eclipse를 다시 시작한 다음 진행률보기를 확인하십시오. 색인 파일을 다운로드해야합니다.

다운로드가 완료되면 아티팩트 검색을 사용할 수 있습니다.

Maven 설정

업데이트 또한 'maven repository view'에서 Maven 저장소 인덱스를 다시 빌드해야합니다.

이보기에서 'Global Repositories'를 열고 'central'을 마우스 오른쪽 버튼으로 클릭하고 'Full Index Enable'을 선택한 다음 동일한 메뉴에서 'Rebuild Index'를 클릭합니다.

66M 색인 파일이 다운로드됩니다.

Maven 저장소-> 인덱스 다시 작성


회사 프록시 내부에 있고 새 프로젝트가 프록시 자격 증명이있는 올바른 settings.xml 파일을 가리 키지 않는 경우이 결과를 얻을 수 있습니다.

Maven 프록시 (예 : Nexus)를 사용 중이고 프록시에 대한 색인이 어떻게 든 엉망이 된 경우에도이를 얻을 수 있습니다. 이 문제를 해결하는 방법을 설명하는 방법을 모르겠습니다. 장난을 치거나 Maven 프록시를 설정 한 사람에게 전화하세요.

You can also get this if the new workspace hasn't yet downloaded the index either from Maven central or from the proxy. (This is the best one as you just have to wait a while and it will work itself out.)


In your eclipse, go to Windows -> Preferences -> Maven 환경 설정 Maven 스크린 샷 Tick the option "Download repository index updates on startup". You may want to restart the eclipse.

Also go to Windows -> Show view -> Other -> Maven -> Maven repositories Maven 저장소보기 스크린 샷

On Maven repositories panel, Expand Global repositories then Right click on Central repositories and check "Full index enabled" option and then click on "Rebuild index".

Full Index Screenshot


The maven add dependency is actually from the maven indexes. If the indexes is up to date, the result should be from there.

If you go to the maven repository, then select global repository, you should see a central ... tab, and select that, there should be a list of folders, and you should be able to see all the indexes from there. If not, then it means you didn't get the full index, then you can right click that and enable full index.

Another thing I annoyed me most is even I did everything, it still not showing anything when I type "spring". This is actually where I did wrong. If you just type some additional text "springframework", BOOM, the result is there.


For me for this issue worked to:

  • remove ~/.m2
  • enable "Full Index Enabled" in maven repository view on central repository
  • "Rebuild Index" on central maven repository

After eclipse restart everything worked well.


I have the same problem. None of the options suggested above worked for me. However I find, that if I lets say manually add groupid/artifact/version for org.springframework.spring-core version 4.3.4.RELEASE and save the pom.xml, the dependencies download automatically and the search works for the jars already present in the repository. However if I now search for org.springframework.spring-context , which isnt in the current dependencies, this search still doesn't work.


사용 https://search.maven.org/ 수동으로 접두사 FC : 클래스 이름을 검색합니다. Netbeans와 Eclipse는 모두 검색 인터페이스를 사용하기에는 너무 어리석은 것처럼 보이며 다운로드 된 저장소 색인의 기가 바이트에는 클래스 정보가 포함되어 있지 않은 것 같습니다. 디스크 공간의 총 낭비. 이러한 IDE 프로젝트는 최근에 유지 관리가 너무 나쁘기 때문에 개발을 GitHub로 옮기기를 바랍니다.


필요한 jar 파일을 다운로드하려면 Group Id 및 Artifact Id를 제공해야합니다. 검색하려면 이러한 필드에 *, *를 사용하십시오.

참고 URL : https://stackoverflow.com/questions/14059685/eclipse-maven-search-dependencies-doesnt-work

반응형