Arnaud: thanks for the link.
After plundering around, I found that adding wtp version 2.0 to the pom automatically added the required attributes to the classpathentries like this:
<classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.15/log4j-1.2.15.jar" sourcepath="M2_REPO/log4j/log4j/1.2.15/log4j-1.2.15-sources.jar">
<attribute value="/WEB-INF/lib" name="org.eclipse.jst.component.dependency"/>
A nice feature was that the attribute was only added if the maven dependency scope was compile or runtime. Small question though: If the scope is provided, the maven eclipse plugin doesn't add any attribute to the corresponding classpathentry. The wtp plugin for eclipse seems to support the following attribute for entries that are not to be deployed:
Maybe you should add this for scope provided? Just a thought..