Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Missing maven dependencies from deployment assembly

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
like image 391
Jan Krakora Avatar asked Jun 30 '15 20:06

Jan Krakora


2 Answers

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.
like image 121
Jebil Avatar answered Nov 15 '22 06:11

Jebil


can you please try to cleanse setup by following below steps

  1. disable Maven nature of application :

Right Click Project -> Maven -> Disable Maven Nature
  1. open cmd , go to project location , Run mvn clean install eclipse:eclipse -Dwtpversion=2.0(This goal just deletes the .project, .classpath and .settings/ files/directories. You can also just remove those files (again while the project is open) instead of running mvn eclipse clean.)

  2. Re-enable the maven nature. (Most of the time, this can be done by right-clicking on the project in question in the package explorer pane, and then choosing 'Configure'-> 'Convert to Maven Project')

other things you can try of

1. reimport project into some other workspace 
2. resintall eclipse 

if it still didn't solve your problem , most probably you might need to raise Jira to eclipse team .

like image 24
Bhupi Avatar answered Nov 15 '22 06:11

Bhupi