Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse 3.7/Indigo m2e WTP integration dependency issue

I've just switched over to Eclipse Indigo from Helios, and I've run in to some bother when attempting to run a Maven-enabled web project on Tomcat 6 with WTP.

I'm experiencing the classic problem of Tomcat not seeing the Maven dependencies. In Helios, the workaround was to add the Maven dependencies to the Deployment Assembly via: Project properties -> Deployment Assembly -> Add 'Java Build Path Entries' -> Maven Dependencies

Unfortunately, the option of 'Java Build Path Entries' isn't being listed, only 'Folder' and 'Project'. I'm not sure if this is intentional, or if there's something wrong with my setup.

In an attempt to remove external factors, I'm using the following setup:

  • Fresh installation of Eclipse Indigo (Mac)
  • Fresh workspace
  • m2e WTP Integration installed via Eclipse Marketplace
  • Create new Maven project
  • Add in some maven dependencies, plus some code to use them
  • Convert project to faceted form
  • Add 'Dynamic Web Module' facet
  • Maven > Update Project Configuration
  • Add to a Tomcat 6 Server
  • Run on server

At this point, I see get ClassNotFoundException relating to my missing dependencies. If I run 'mvn war:war' and include the assembled 'WEB-INF/lib' directory in the project's Deployment Assembly, then of course the dependencies are correctly picked up - fine for a quick fix, but not ideal.

Most of the problems I've read about relating to similar issues has been down to a missing WTP integration module, but that doesn't appear to be the problem for me.

Am I doing something wrong?

like image 378
sebrichards Avatar asked Aug 18 '11 17:08

sebrichards


1 Answers

It looks like the packaging type of the new maven project is jar. If so, you could change it to war and try.

like image 80
Raghuram Avatar answered Oct 01 '22 05:10

Raghuram