本地 Java 项目 jar 未添加到 Maven 构建的 war - Eclipse 3.6 Helios
在 Helios 中,旧的“EE 模块依赖项”被“部署程序集”取代,但它仍然做同样的事情,允许添加外部项目,在本例中是一个纯 Java 项目。
这一切在本地工作正常,但是当我让 Maven 构建部署战争时,不会为本地 java 项目添加 jar。该项目不在 Maven 中,但我已经关闭了“解决工作区依赖项”,并且在 Eclipse 3.5 中,这将允许我按上述方式添加项目,并使 jar 显示在 WEB-INF/lib 文件夹中。
有什么想法为什么这不再起作用了吗?
In Helios, the old "EE Module Dependencies" was replaced with "Deployment Assembly" but it still does the same thing, allows for the addition of external projects, in this case, a pure Java Project.
This all works fine locally, but when I have Maven build the war for deployment, a jar is not added for the local java project. The project is not in Maven, but I have turned off the "resolve workspace dependencies" and in Eclipse 3.5, this would allow me to add the projects as described above, and have the jar's show up in the WEB-INF/lib folder.
Any ideas why this isn't working anymore?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 Eclipse 3.7 (Indigo) 中,m2eclipse 被更新并重命名,但 war 插件的行为在我看来没有改变:
只需打开 pom.xml 并检查依赖项部分。你的java项目不应该是“可选的”,也不应该是“提供的”依赖项。 此处描述了 war 插件的行为。您可以激活“解决工作区依赖关系”,但您的“普通”Java 项目也应该有一个 pom。如果您的 war 的 Maven 构建失败(仔细检查),您应该在其他项目上调用“安装”(或者您可以 如果您不想为其创建 pom.xml,请手动为其安装 jar )。
In Eclipse 3.7 (Indigo) m2eclipse was renewed and renamed but the behavior of the war plugin did not change imo:
Simply open your pom.xml and check the dependencies section. Your java project should not be "optional" and should not be a "provided" dependency. The behavior of the war plugin is described here. You can activate "resolve workspace dependencies" but your "plain" Java project should have a pom as well. If the maven build of your war fails (double check that) you should invoke "install" on your other project (or you can install a jar for it manually if you don't want to make a pom.xml for it).
您可以使用 pom 进行聚合。要查看聚合的实际效果,只需查看 Maven 或 Maven 核心插件 基础 POM。
you may use a pom for aggregation. To see aggregation in action, just have a look at the Maven or Maven Core Plugins base POM's.