使用版本范围时 m2eclipse 的奇怪行为
我已经在服务器上使用 Nexus 设置了 Maven 存储库。我已将各种项目工件和第三方库部署到此存储库。
现在我尝试在 Eclipse IDE 中通过 m2eclipse 插件使用此存储库。 我的想法是,我应该能够签出一个项目,启用 Maven 依赖项管理选项,并且它应该从远程存储库下载所有依赖项。
当我使用特定版本的依赖项时,这似乎有效,但是当我尝试使用版本范围时,它会失败,并提示缺少工件。
这是奇怪的事情......如果我检查项目父 POM 并在父项目上启用依赖项管理,它将下载它的依赖项,然后子父项也会得到解析。 我确信我不必这样做,您应该能够检查任何项目,并且它的依赖继承关系应该自动解决。当我不使用版本范围时就是这种情况。
还有其他人遇到过这个问题吗?我觉得我的设置中好像缺少了一个步骤。
提前致谢。
I have set up a Maven respotory with Nexus on a server. I have deployed various project artefacts and third party libraries to this repository.
Now I'm trying to use this repository in my eclipse IDE with the m2eclipse plugin.
The idea is that I should just be able to check out a project, enable the Maven dependency management option and it should download all it dependency from the remote repository.
This seems to work when I use specific versions for dependencies, but when I try to use version ranges it will fail, saying missing artefacts.
Here's the strange thing.....if I check out the projects parent POM and enable the dependency management on the parent project, it will download it's dependencies and then child parent also gets resolved.
I sure I shouldn't have to do this, you should be able to check out any project and it's dependency heirarcy should get resolved automatically. Which IS the case when I don't use version ranges.
Has anyone else had this problem? I feel lilke I'm missing a step in my setup somewhere.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试过使用命令行 maven 构建项目? m2eclipse 有它的怪癖,因此从等式中删除它会告诉您这是 m2eclipse 问题还是 Maven 问题。
如果使用 Maven 手动构建有效,那么这可能是 m2eclipse 问题。我会尝试迁移到 Eclipse Indigo,因为它内置了 m2eclipse(以及自旧 m2eclipse 的最后版本以来一年多的开发工作)。使用最新版本可能会消除任何错误。
如果手动构建不起作用,那么您可能在 pom 文件或项目结构中执行了错误的操作。在这种情况下,请发布一些您的 pom 和您的项目结构。
Have you tried building the project with command line maven? m2eclipse has it's quirks, so removing it from the equation will tell you if it's an m2eclipse problem or a maven problem.
If building manually with maven works, then it's probably an m2eclipse issue. I would try moving to Eclipse Indigo as it has m2eclipse built in (as well as over a year of development work since the last version of the old m2eclipse). Using the newest version might eliminate any bugs.
If building manually doesn't work, then you're probably doing something incorrect in your pom files or your project structure. In this case, please post some of your poms and your project structure.