java - 使用远程目录 URL 时无法从 Maven 获取任何原型(prototype)

标签 java eclipse apache maven

我正在尝试创建一个新的 Maven 项目,但我做不到。我尝试了命令行,也尝试了 Eclipse。

我在尝试使用命令行时遇到的错误是

[ERROR] No plugin found for prefix 'archetype' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\MY_NAME.m2\repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.

[ERROR]

[ERROR] For more information about the errors and possible solutions, please read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException

在四处寻找错误的解决方案后,问题似乎出现了,因为我在工作中受防火墙/代理的保护。

然后我被建议进入 Eclipse 并尝试将远程目录 URL 添加到 Eclipse。我所做的是转到 Windows > Preferences > Maven > Archetypes > Add Remote Catalog。然后我将它放在 http://repo1.maven.org/maven2/archetype-catalog.xml 用于“Catalog File”字段和 maven catalog 用于“Description”字段。

然后我单击验证以查看它是否正常工作,我收到一条警告,指出“远程目录为空”。

无论如何,我继续尝试创建一个新的 Maven 项目。填写我的 groupId 等所有内容后,我单击“完成”。出现另一个错误

Could not resolve archetype

org.apache.maven.archetypes:maven-archetype-webapp:1.0 form any of the configured repositories.

我该如何解决这个问题?

最佳答案

我今天通过先在浏览器中下载文件然后将其添加为本地文件来修复它

关于java - 使用远程目录 URL 时无法从 Maven 获取任何原型(prototype),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37963852/

相关文章:

java - 将数据从子 Activity 发送到主要 Activity

IBM Websphere 中的 Java 7.1

Javassist API 与 Junit

java - 使用 http ://xyz. abc.com:9000 访问 Sonarqube

java - 使用类路径中的 Kotlin 运行时库执行 Java 和 Kotlin 程序

eclipse - 在 Eclipse IDE 中制作自定义项目模板

java - 如何解决 "This element has no attached source and the Javadoc could not be found in the attached Javadoc"?

php - Apache + PHP 中的 "End of script output before headers"

php - 为每个站点设置 php.ini 指令

apache - 如何在 Plack/Apache 中拦截回复