m2eclipse 工作空间分辨率
我正在使用 m2eclipse 来管理 eclipse 中的 Maven 项目。似乎在我使用的上一个版本(0.9.8)中,工作区分辨率根本不起作用,但现在它也不能像我预期的那样工作。即,当项目的“从工作区解析依赖项”设置未选中时,该项目将变为红色并且无法构建。该消息显示:在本地存储库(或某种程度的东西)中找不到工件 xxx xy-SNAPSHOT。问题是 m2eclipse 正在将有关工作区项目的信息放入我的本地存储库中。 有没有办法改变这种行为?
PS 解决方法是关闭 xxx 项目,然后 m2eclipse 解决对我之前在本地存储库中拥有的任何版本(即非快照版本)的依赖关系。
PS2 屏幕截图显示了我在本地存储库中的内容:
- Eclipse 中的 Maven 存储库
alt text http:// /img96.imageshack.us/img96/1498/mvnrepos.png
- 相关工件的文件系统版本
替代文本http://img155.imageshack.us/img155/2999/versions.png
- 快照目录中有什么:
I am using m2eclipse for managing maven projects in eclipse. It seems that in the previous release that I was using (0.9.8) the workspace resolution did not work at all, but right now it also does not work quite as I would expect. Namely, when the "resolve dependencied from workspace" setting for a project is not checked, the project turns red and cannot be build. The message says: artifact xxx x.y-SNAPSHOT cannot be found int local repository (or something to that extent). The trouble is that m2eclipse is putting information about workspace project into my local repo.
Is there a way to change this behaviour?
P.S. The workaround for this is to close the xxx project, then m2eclipse resolved the dependency to whatever version I've had previously in the local repository (i.e. the non-snapshot version).
P.S.2 screenshots showing what I have in the local repo:
- Maven repos in eclipse
alt text http://img96.imageshack.us/img96/1498/mvnrepos.png
- filesystem versions of the artifact in question
alt text http://img155.imageshack.us/img155/2999/versions.png
- what is in the snapshot dir:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这不是我所经历的。我有一个项目依赖于另一个项目,并且当前正在使用工作区分辨率:
alt text http://img180.imageshack.us/img180/9454/screenshot007l.png
如果我取消选中解决工作区项目的依赖关系(在属性> Maven下) )并应用更改,我的构建路径变为:
alt text http://img704.imageshack .us/img704/8869/screenshot007zh.png
依赖已按预期更改为二进制依赖。
That's not what I'm experiencing. I have a project that has a dependency on another project and that is currently using workspace resolution:
alt text http://img180.imageshack.us/img180/9454/screenshot007l.png
If I uncheck Resolve dependencies from Workspace projects (under Properties > Maven) and apply the change, my build path becomes:
alt text http://img704.imageshack.us/img704/8869/screenshot007zh.png
The dependency is changed into a binary dependency as expected.
好吧,现在我的答案是降级到 0.9.8 版本,其中插件不会干扰本地存储库。
OK, for now the answer for me has been to downgrade to version 0.9.8, in which the plugin does not mess with the local repo.