简体   繁体   中英

Eclipse Java EE New Maven Project: Could not resolve archetype

I am using the latest Eclipse Java EE (Kepler) and trying to create a Maven project. When I attempt to do this, and finally click the Finish button, I get this error:

Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quickstart:RELEASE from any of the configured repositories.

All I have done in terms of "set-up" is install Eclipse Java EE (I also installed the main eclipse standard 4.3 earlier). I am also on a work computer, and a proxy test I ran returned the result: This request appears to have come via a proxy .

This has driven me nearly insane, so any help would be great! Thanks!

请验证,在 Eclipse 中,Windows > 首选项 > Maven > 用户设置,请检查用户设置文件 (settings.xml) 是否存在,并且该文件中的代理设置是否正确指向您的代理服务器。

Adding the following inside "mirrors" section in the user setting.xml file.

<!-- mirrors so we can control the access of artifacts and avoid going to 
    the internet for artifact metadata -->
<mirrors>
    <mirror>
        <id>maven repo</id>
        <url>http://repo.maven.apache.org/maven2</url>
        <mirrorOf>central</mirrorOf>
    </mirror>
</mirrors>

The official Maven 2 repository is at http://repo.maven.apache.org/maven2 hosted in the US, or http://uk.maven.org/maven2 hosted in the UK.

删除 C:\\Users\\ {your username}\\ .m2\\repository\\org\\apache\\maven 文件夹并再次尝试创建您的 maven 项目。

You can also add

<mirror>
  <id>ibiblio.org</id>
  <url>http://mirrors.ibiblio.org/maven2</url>
  <mirrorOf>central</mirrorOf>
</mirror>

Best solution as below:

  1. Close Eclipse
  2. Delete repository folder (you can find it in C:\\Users{your user}.m2)
  3. Open Eclipse again. It will install maven repository automatically
  1. Open Window > Preferences
  2. Open Maven > Archetypes
  3. Click 'Add Remote Catalog' and add the following:

除了上面提到的,我需要将代理协议从https修改为http

I had same problem and struggled lot to fix it out. I tried many thing including all the above answer.

I solution worked for me is, I created the first Hello World project through command prompt (while creating first time it downloaded lot of things) and then I tried in eclipse. It worked for me !!!.

To create from Command Prompt, please follow the video from the below link.

https://javabrains.io/courses/buildsys_mavenintro/lessons/Introduction-and-Setting-up-Part-1

This exact same problem i came through but instead of quickstart, for me it was webapp.

What i did to resolve the issue was:

step 1) to simply go down to path C:\\Users\\$username$\\.m2\\repository\\org\\apache\\maven\\archetypes\\maven-archetype-webapp and delete the folder named "maven-archetype-webapp" (for you it may be quickstart). Yes delete the whole folder.

step 2) give your system internet access

step 3) close eclipse and and restart it again

what it will do is download the repository again.

This solution worked for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM