In my case, I had an existing project that was deployed in Eclipse fine. Thank you Mkyong: http://www.mkyong.com/spring-security/spring-security-hello-world-example/
But when I needed to add JSTL for Logout tag support, I didn't see how to add the the jstl.jar file that was just pulled into my repo as another M2_REPO/xyz configuration. Instead, I could only import it as you would a regular .jar file - and that didn't seem right to me.
After reading a bunch of posts without success, I decided to see if I could get around the Eclipse UI and update the project configuration manually. From the project I opened .classpath in a text editor and added a new entry for the jar file:
<classpathentry kind="var" path="M2_REPO/javax/servlet/jstl/1.2/jstl-1.2.jar" sourcepath="M2_REPO/javax/servlet/jstl/1.2/jstl-1.2.jar">
<attributes>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
Then I just refreshed my project in Eclipse (no restart required) and ...
- the JSTL build error I was having in my JSP page went away
- the build path entry for JSTL was appearing with the same M2_REPO as the other entries
- the deployed code worked fine in Tomcat
Yes a bit of a hack, but still relatively clean I think - cheers