Eclipse에서 Maven 프로젝트를 만들면 "Could not resolve archetype"이 표시됩니다.
이 질문에 이미 답변이 있습니다.
나는 Maven과 완전히 초보자입니다. 아키 타입 "webapp"을 사용하여 Eclipse Juno EE로 Maven 프로젝트를 만들고 싶습니다. "Maven Integration for Eclipse WTP (incubation)"를 설치했고 "Maven Integration for Eclipse"도 설치했습니다 (Eclipse Marketplace의 설치됨 탭에서 찾았습니다). File-> New_> Maven Project 에서 새 프로젝트를 만들려고하면 오류가 발생합니다.
구성된 저장소에서 archetype org.apache.maven.archetypes : maven-archetype-webapp : RELEASE를 확인할 수 없습니다. 이슈 org.apache.maven.archetypes : maven-archetype-webapp : pom : RELEASE를 해결할 수 없습니다. org.apache.maven.archetypes : maven-archetype-webapp : pom : RELEASE의 버전을 확인하지 못했습니다. 로컬에서 org.apache.maven.archetypes : maven-archetype-webapp / maven-metadata.xml 메타 데이터를 찾을 수 없습니다 (C : \ Documents and Settings \ PEP35KD \ .m2 \ repository) org.apache.maven.archetypes : maven-archetype-webapp : pom : RELEASE의 버전을 확인하지 못했습니다. 로컬에서 org.apache.maven.archetypes : maven-archetype-webapp / maven-metadata.xml 메타 데이터를 찾을 수 없습니다 (C : \ Documents and Settings \ PEP35KD \ .m2 \ repository)
모든 종류의 원형에서 발생합니다. 프록시를 사용하고 있으며 C : \ Documents and Settings \ PEP35KD.m2 \ 아래에 다음 내용으로 settings.xml 파일을 만듭니다.
<proxies>
<proxy>
<id>myId</id>
<active>true</active>
<protocol>http</protocol>
<username>rete\pep35kd</username>
<password>XXXX</password>
<host>XXXX</host>
<port>8080</port>
<nonProxyHosts>localhost</nonProxyHosts>
</proxy>
</proxies>
명령 줄에서 mvn 명령을 사용할 수없는 것 같습니다 (명령을 찾을 수 없음). Maven 자체를 설치 한 적이 없으며 플러그인만으로 충분하다고 생각했습니다. 올바른 가정입니까?
업데이트 문제는 확실히 프록시와 관련이 있습니다. 으로:
- 로컬 PC에 Maven 설치;
- Eclipse Market Place에서 Maven Eclipse 설치
- Maven 설치 디렉토리를 기본 Embedded Maven 대신 로컬 PC Maven 디렉토리로 설정
모든 것이 예상대로 작동합니다. 왜 그런지 이해할 수 없지만 방화벽이 Maven 서버의 트래픽을 차단하고있을 것입니다.
이 다른 StackOverflow 질문에 대한 해결책에 따라이 문제를 해결했습니다.
나는 같은 문제가 있었다. eclipse에 maven archetype 카탈로그를 추가하여 수정했습니다. 단계는 다음과 같습니다.
- 창 열기> 환경 설정
- Maven> 아키 타입 열기
- '원격 카탈로그 추가'를 클릭하고 다음을 추가하십시오.
- 카탈로그 파일 : http://repo1.maven.org/maven2/archetype-catalog.xml
- 설명 : Maven 카탈로그
프록시 설정이 올바르다 고 가정하면 Eclipse가 의도 한 settings.xml
파일 을 가리키는 것을 놓쳤을 수 있습니다 . 이는 Maven을 스냅인으로 설치하고 Eclipse 외부에 외부 설치를 둘 때 자주 발생합니다. Eclipse에서 사용해야하는 Maven 설치와 찾아야하는 settings.xml 파일을 알려야합니다.
먼저 settings.xml 파일에 프록시 설정이 포함되어 있는지 확인하십시오.
다음으로 여기에있는 user settings.xml 파일에 프록시 설정이 포함되어 있는지 확인합니다.
변경 한 경우 Eclipse를 다시 시작하십시오.
사용자 setting.xml 파일의 "미러"섹션 내부에 다음을 추가하면 저에게 효과적이었습니다.
<mirror>
<id>ibiblio.org</id>
<url>http://mirrors.ibiblio.org/maven2</url>
<mirrorOf>central</mirrorOf>
</mirror>
가장 쉬운 방법은 .m2 폴더를 제거 / 삭제하고 다시 생성하여 settings.xml 구성 세부 정보 (해당되는 경우)를 되 돌리는 것입니다.
Add your MAVEN_HOME
environment variable, edit your Path to include %MAVEN_HOME%/bin
then try creating the project manually with Maven:
mvn archetype:generate -DgroupId=com.program -DartifactId=Program -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false
Then import the existing Maven project to Eclipse.
You can resolve it by configuring settings.xml in Eclipse.
Go to Window --> Preferences --> Maven --> User Settings --> select the actual path of settings.xml
I find it solution http://www.scriptscoop.net/t/7c42f9d698a4/java-create-maven-project-could-not-resolve-archetype-connection-refused.html
We can see the origin of the problem : Connection refused: connect
I have already do this :
1) Window -> Preferences -> General -> Network Connections. I put in Manual with the url and port of my proxy for HTTP protocol. It works because before this, Spring Tool Suite did not want to update. After, it's okay.
2) Window -> Preferences -> Maven -> User Settings. In Global Settings, is empty. In User Settings, I put the path to settings.xml. In this file, i have :
Goto Preferences: -> Maven Click 'Add Remote Catalog' File: http://repo1.maven.org/maven2/archetype-catalog.xml Desc: Catalog
It is also possible that your settings.xml file defined in maven/conf folder defines a location that it cannot access
click windows-> preferences->Maven. uncheck "Offline" check box. This was not able to download archetype which I was using. When I uncheck it, Everything worked smooth.
First things first, you have to install Maven on your workstation. You need also to install M2E, what you obviously did. Not all distributions of Juno have it pre-installed.
Then configure your Eclipse so it can find your Maven install. In the menu Window -> Preferences, then open the Maven section. In your right panel, you have a list of the Maven installations Eclipse knows. Add your installation and select it instead of the embedded Maven provided with M2E. Don't forget to set the "Global settings from installation directory" field with the path to the settings.xml of your Maven installation.
Which leads us to the settings.xml. If the above doesn't solve your problem, you will have to configure your Maven. More infos here.
This might sound silly, but make sure the "Offline" checkbox in Maven settings is unchecked. I was trying to create a project and got this error until I noticed the checkbox.
Goto Preferences: -> Maven
1. check Download Artifact Source
2. check Download Artifact JavaDoc
Eclipse에서 웹 앱을 만드는 동안 비슷한 오류가 발생하고 Maven 저장소를 정리 (모든 파일 삭제)하고 다시 빌드하여 문제를 해결했습니다.
eclipse에 m2eclipse 또는 다른 Maven 플러그인을 설치해야합니다. 일부 Eclipse에는 Maven과 플러그인이 설치되어 있습니다. 그렇지 않으면 Help-> software Install로 이동하여 All sites를 선택하고 maven으로 목록을 필터링 한 다음 플러그인을 설치합니다. 그럼 이 링크를 보세요 . 도움이 되었기를 바랍니다.
'Program Tip' 카테고리의 다른 글
`vi`의 선택 항목 내에서 찾기 및 바꾸기 (0) | 2020.11.29 |
---|---|
모든 줄 바꿈을 제거하고 특정 텍스트 뒤에 추가 (0) | 2020.11.29 |
Java에서 메소드 숨김이란 무엇입니까? (0) | 2020.11.29 |
Interface Builder가 drawRect를 재정의하지 않는 IBDesignable 뷰를 렌더링하는 방법이 있습니까? (0) | 2020.11.29 |
Lua 패턴 매칭과 정규 표현식 (0) | 2020.11.28 |