Java 使用原型选择在 Eclipse 中创建 Maven 项目时出错
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20987346/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Error while creating Maven project In Eclipse using archetype selection
提问by Sandeep
When I am trying to create maven project it is showing below error
当我尝试创建 maven 项目时,它显示以下错误
Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quickstart:RELEASE from any of the configured repositories.
Please help me with the solution.
请帮我解决。
回答by Gaurav Katkamwar
Please check if you configured your maven in eclipse properly
1. Go to preference-->Maven-->Installation
In this add the path of working maven directory
2. Go to preference-->Maven-->User Setting
In this add the path of your maven_directory/conf/setting.xml
Try with these setting let us know if it works...cheers
请检查您是否在eclipse中正确配置了maven
1.转到preference-->Maven-->Installation
在此添加工作maven目录的路径
2.转到preference-->Maven-->User Setting
在此添加您的 maven_directory/conf/setting.xml 的路径
尝试使用这些设置让我们知道它是否有效...干杯
回答by Kamlesh Arya
You need to add maven archetype catalog to eclipse
您需要将 Maven 原型目录添加到 Eclipse
- Window>Preferences
- Maven>Archetypes
Add Remote Catalog and add the following:
Catalog File: http://repo1.maven.org/maven2/archetype-catalog.xml
Description : maven catalog
- 窗口>首选项
- Maven>原型
添加远程目录并添加以下内容:
目录文件:http: //repo1.maven.org/maven2/archetype-catalog.xml
描述: Maven 目录
After adding archetype,restart eclipse.
添加原型后,重新启动eclipse。
回答by Moustafa Essa
If you are using Eclipse over Windows 7, then make sure you are running eclipse with enough privileges (Run as administrator). Furthermore, configure the Proxy settings for MAVEN as folks stated in the previous answers, and make sure that Eclipse Proxy settings are set too.
如果您在 Windows 7 上使用 Eclipse,请确保您以足够的权限运行 eclipse(以管理员身份运行)。此外,按照前面答案中的说明为 MAVEN 配置代理设置,并确保也设置了 Eclipse 代理设置。
回答by Naresh Vavilala
If you are using eclipse luna EE version, GO TO Windows -> Preferences -> Maven and uncheck the following option
如果您使用的是 eclipse luna EE 版本,请转到 Windows -> Preferences -> Maven 并取消选中以下选项
Do not automatically update dependencies from remote repositories.
Do not automatically update dependencies from remote repositories.
This option is checked by default.
默认情况下选中此选项。
回答by shubham
Just check the checkbox coming on first popup while creating Maven module. Checkbox name - "Create a sample project(skip archetype selection)"and go ahead with rest of the procedure, you will not get any errors.
只需在创建 Maven 模块时选中第一个弹出窗口中的复选框。复选框名称 - “创建示例项目(跳过原型选择)”并继续执行其余过程,您将不会收到任何错误。