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.
I am following this tutorial, suggested by a SOF member : http://www.beingjavaguys.com/2013/08/spring-maven-web-application-in-eclipse.html
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 :
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...
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/.../...
Happy Holidays everyone, and thanks in advance for any help on this Myna
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:
The way to add that in is:
- click on Add
- select Java Build Path Entries
- select Maven Dependencies
- Finish
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
.
Hope that helps.
Open your project folder and find the .classpath file,edit it and add follow code
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With