Missing maven dependencies from deployment assembly

Behnil picture Behnil · Jun 30, 2015 · Viewed 31.8k times · Source

I've recently upgraded from eclipse 4.4.2 (Luna) to 4.5 (Mars). My dynamic web project now doesn't include the Maven Dependencies in its deployment assembly "Project->Properties->Deployment assembly".

I can add them manually (using "Project->Properties->Deployment assembly->Add->Java Build Path Entries->Maven Dependencies"), but every time I run "Project->Maven->Update Project Configuration", the Maven Dependencies are removed again.

Note that I run the project using the Apache Tomcat Server within the Eclipse IDE.

I have installed

  • m2e 1.6.0.20150526-2032
  • m2e-wtp 1.2.0.20150602-1740

Answer

Jebil picture Jebil · Jul 7, 2015

This should have nothing to do with eclipse and m2eclipse, and optionally for better support - m2e-wtp. Also, you don't need copy-dependencies. Here are a few possible reasons:

  • you should invoke mvn package (or right-click > maven > package) and obtain a war file - the (in the pom) must be war

    <packaging>war</packaging>

  • your dependencies should be with the default scope (if they are provided or test they will not be included in the archive)

  • if you are running the project as dynamic web project on a server within eclipse, then you should open the project properties (right click > properties) and select "Deployment Assembly". There click "add", select "build path entries", and choose "maven dependencies". This will instruct WTP to send the maven dependencies to the server dir.