Maven依赖关系未添加到WEB-INF / lib [英] Maven dependencies not being added to WEB-INF/lib

查看:626
本文介绍了Maven依赖关系未添加到WEB-INF / lib的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Spring,Maven,Tomcat以及所有这些相当新鲜,我试图在Eclipse中设置一个Spring Web项目,使用Maven然后将项目部署到Tomcat。

Fairly new to Spring, Maven, Tomcat and all, I am trying to set up a Spring Web Project in Eclipse, using Maven then deploy the project to Tomcat.

我正在跟随本教程,由SOF成员建议: http://www.beingjavaguys.com/2013/08/spring-maven-web-application-in-eclipse.html

I am following this tutorial, suggested by a SOF member : http://www.beingjavaguys.com/2013/08/spring-maven-web-application-in-eclipse.html

我有麻烦让Maven将 pom.xml 中指定的依赖项添加到Tomcat的 WEB-INF / lib中。我严格遵循了这些步骤,但是在Eclipse中运行Spring Maven项目中,我没有得到相同的部署程序集截图。这是我得到的:

I am having troubles to have Maven add the dependencies specified in pom.xml, to Tomcat's WEB-INF/lib. I have scrupulously followed the steps, but in the part "Run Spring Maven project in eclipse", I do not get the same deployment assembly screenshot. This is what I get :

我在Eclipse中检查了WTP在这里,它是帮助 - >安装新软件 - >链接安装什么?)但是我看到的m2e-wtp的版本是1.0。所以我试图运行 mvn eclipse:eclipse -Dwtpversion = 1.0 命令(使用版本1.0而不是2.0),但仍然是同样的问题...

I checked in Eclipse that WTP is here, and it is (Help -> Install new Software -> Link "what is installed?") However the version I see for m2e-wtp is 1.0.**. SO I tried to run the mvn eclipse:eclipse -Dwtpversion=1.0 command (using version 1.0 instead of 2.0) but still the same problem...

任何人都有同样的问题?我已经看到类似的问题,尝试了什么建议,但没有为我工作不幸。例如,我进入Web部署程序集,然后单击添加 - > Java构建路径条目,但是我没有看到 Maven依赖关系复选框:我看到的是一个表单 M2_REPO /.../...

Anybody has had the same problem ? I have seen similar questions, tried what was suggested but nothing worked for me unfortunately. For example I went in Web Deployment Assembly and clicked Add -> Java Build Path Entries but I don't see a Maven Dependencies checkbox : what I see is a list of entries of the form M2_REPO/.../...

祝大家快乐,并提前感谢您对此
Myna的任何帮助

Happy Holidays everyone, and thanks in advance for any help on this Myna

推荐答案

看起来您的部署程序集缺少添加到项目的打包结构中的Maven依赖关系。
应该看的方式是:

Looks like your "Deployment Assembly" is missing the Maven Dependencies being added to the packaging structure of your project. The way this should look is:

添加的方式是:_
- 点击添加

- 选择 Java构建路径条目

- 选择 Maven依赖关系

- 完成

The way to add that in is:
- click on Add
- select Java Build Path Entries
- select Maven Dependencies
- Finish

将您的Maven依赖关系添加到 WEB-INF / lib 中。
如果您的项目结构不是标准的,您还可以通过双击 Deploy Path 列中的内容来编辑该路径 - 在这种情况下, WEB-INF / lib中

That should add your Maven Dependencies into WEB-INF/lib. In case your project structure is not standard, you can also edit that path by double-clicking inside your Deploy Path column - in this case, on WEB-INF/lib.

希望有所帮助。

这篇关于Maven依赖关系未添加到WEB-INF / lib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆