在 Eclipse Oxygen 中创建 maven-archtype
项目时出现以下错误。
Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webapp:1.0 from any of the configured repositories.
Could not resolve artifact org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0
Failure to transfer org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org
Failure to transfer org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org
我可以使用以下链接从浏览器完美访问 Maven 存储库:
https://repo.maven.apache.org/maven2/
我正在使用我的办公室笔记本电脑,它位于安全网络后面。
通过引用其他类似问题的答案,我已经尝试将 settings.xml
放在 .m2
目录中。我不知道要使用哪个代理,因此我只是将系统凭据放入 username
和 password
标记中。但这没有用。
我还尝试在 Eclipse Maven 设置中添加 Maven_Archtype。仍然无法工作。
有人遇到过这个问题吗?请指出正确的解决方案,它已经得到解答。
最佳答案
当您已经安装了 Eclipse 较旧版本(例如 Kepler 或 Mars),然后单独安装较新版本时,通常会发生这种情况,此较新版本会访问较旧版本的某些目录。因此,
- 转到---->
C:\Users\Irfan(您的用户名)
- 删除这两个文件夹
.eclipse
和.m2
。 - 再次重新安装较新版本的 Eclipse。
关于java - 创建项目时 Eclipse Oxygen 上的 Maven 出现 "Could not resolve archetype"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44970149/