如何设置“构建” Eclipse 中 Maven 项目之间的依赖关系?
我对 Maven 相当陌生,我找不到这个小(恕我直言)问题的解决方案。
在我的 Eclipse 工作区中,我有一个 OSGi 捆绑包的 Maven 项目(常规的,不是 Eclipse 插件)。它依赖于几个工件(JAR 库);我需要从工作区中的另一个 Maven 项目构建其中之一。当我重建捆绑包时,我希望 Maven 检查其他工件是否也需要重建(即因为我编辑了它的一些代码),如果是,则也重建该工件。这样我可以自动化一些步骤并避免忘记重建内部库。怎么做呢?
谢谢您的帮助!
恩里科
I'm rather new to Maven and I couldn't find a solution to this little (IMHO) problem.
In my Eclipse workspace I have a Maven project for an OSGi bundle (a regular one, not an Eclipse plugin). It depends upon several artifacts (JAR libraries); I need one of them to be built from another Maven project in the workspace. When I rebuild the bundle, I'd like Maven to check whether the other artifact needs to be rebuilt too (i.e. because I edited some of its code), and if so, rebuild that one too. This way I can automatize some steps and avoid forgetting to rebuild the inner library. How to do that?
Thank you for any help!!
Enrico
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
可能有几种方法。您可以从 Maven 模块开始。
http://maven.apache.org/guides/mini/guide -ide-eclipse.html#Multiple_Module_Project
There could be several ways. You could begin with maven modules.
http://maven.apache.org/guides/mini/guide-ide-eclipse.html#Multiple_Module_Project
由于您使用的是 m2eclipse,因此您可以将 m2eclipse 配置为使用“工作区解析”,即将工作区中的项目用作依赖项,而不是二进制依赖项(JAR)。
这样,变化就立即可见。
Since you are using m2eclipse, you can configure m2eclipse to use "workspace resolution" i.e. to use a project from your workspace as a dependency instead of a binary dependency (a JAR).
This way, changes are immediately visible.