eclipse的maven插件,代理问题
我使用 m2eclipse 来集成 Eclipse (Indigo) 和 Maven。我还使用代理,因此我有一个包含正确主机和端口的 Settings.xml。我也配置了操作系统的 LAN 设置,因此 Eclipse 也以相同的方式配置(本机模式)。最后,我将外部 Maven 作为 Eclipse 安装(Maven 2.2.1)。
完成此操作后,我从 Eclipse 导入一个 Maven 项目。当我执行“mvn install”时,工件会被下载,并且我会得到“Build Succesfull”。然而,该项目标记了一个错误。
如果是有依赖项(pom依赖项)的项目和简单项目,错误类型是不同的。例如,在一个简单的项目中,错误是“无法计算构建计划:连接超时”。在复杂的项目中,不会读取存储库中的某些工件。
我认为问题出在插件和代理上,因为 eclipse 启动时控制台中会出现“无法更新中央 的索引http://repo1.maven.org/maven2/”。
有什么想法吗?
谢谢你的帮助,
天使
I use m2eclipse to integrate Eclipse (Indigo) and Maven. I also use a proxy, so I have a Settings.xml with the correct host and port. I've configured the LAN Settings of the OS too, so Eclipse is configured in the same way (Native mode). Finally, I have put an external maven as the Eclipse installation (Maven 2.2.1) .
Once I did that, I import from Eclipse a Maven project. When I do "mvn install" the artifacts are downloaded, and I get the "Build Succesfull". However, the project marks an error.
The error type is different if is a project with dependencies (pom dependencies) or a simple project. For example, in a simple project the error is "Could not calculate build plan: connection timed out". In a complex project doesn't read some artifacts, which are in the repository.
I think the problem is the plugin and the proxy because in the console appears when eclipse starts, "Unable to update index for central http://repo1.maven.org/maven2/".
Any idea?
Thank you for your help
Ángel
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
由于您的构建工作正常,我相信您的
setting.xml
is maven 安装文件夹工作正常。因此,请尝试更改 eclipse 中的 maven 设置,如下所示,并引用 maven 文件夹配置中的相同
setting.xml
。Since your build is working fine I believe your
setting.xml
is maven installation folder is working fine.So try to change the maven setting in eclipse as shown below and refer the same
setting.xml
that is there in the maven folder configuration.这不是一个很有帮助的答案,但我遇到了同样的问题。
m2eclipse 似乎不能很好地处理代理(eclipse 或 .settings)。
当时我的解决方法是始终有一个方便的命令行来引入新的依赖项。
Not a very helpful answer, but I ran into the same problem.
m2eclipse didn't seem to handle proxies (either eclipse or .settings) very well.
My workaround at the time was to always have a command line handy to pull in new dependencies.
我遇到了同样的 Maven 错误问题:
无法计算构建计划:连接超时
最终修复的是完整的清理和重建:
项目>干净...
(x) 清理所有项目
(x) 构建整个工作空间
I had the same problem with the Maven error:
Could not calculate build plan: connection timed out
What finally fixed it was a complete Clean and Rebuild:
Project > Clean...
(x) Clean all projects
(x) Build the entire workspace