Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven/Tomcat Projects In Eclipse Indigo/3.7

I'm trying out the next version of Eclipse using the latest milestone build and I'm having an issue getting my Maven project deployed to Tomcat.

Previously in Eclipse 3.6, my project was automatically enabled as a web project when checked out from SVN. I've checked out my project in 3.7 but get nothing indicating it's runnable as a web project (e.g. trying to run the project doesn't give me the usual "Run on Server" option).

What I've installed is Indigo RC4 "Eclipse IDE for Java EE Developers" version. I then added the latest M2E milestone from here. This enabled me to get up and running, check out my project and I seem to be able to build the project fine (which does create my .war file for remote deployment). Still no "Run On Server" options though.

Does anyone have any clues on what I could be missing? I'm guessing it's a Maven & WTP integration plugin but I haven't spotted the right one yet.

like image 979
Lee Theobald Avatar asked Jun 15 '11 10:06

Lee Theobald


2 Answers

Before m2e became an eclipse project the WTP integration shipped with the core module. Now the core module is an eclipse module and the WTP integration is shipped separately. The current Indigo snapshots of m2eclipse-wtp can be found here. I was unable to get any artifacts from this update site however, even though it's listed in the corresponding JIRA issue.

Fortunately, today m2e-wtp was made available through the m2e Marketplace. Just open the eclipse preferences, go to 'Maven' -> 'Discovery' -> 'Open Catalog' and install it. m2e Marketplace.

like image 141
samy-delux Avatar answered Dec 30 '22 17:12

samy-delux


It will work with the lastet version, it's just the .project that is not right.

Simply go into the project properties, make the projet faceted.. tick Dynamic Web Module and you'll get run on server as an option after that. Update Project Facets

This will enable the "Run on Server" option, however your problems don't finish there as when you then run it, you'll get a 404.

To fix this, go back into project properties, Deployment assembly.

Deployment Assembly

Delete the WebContent entry (and you can delete the folder in the project later too), and make sure you have the src-main-webapp & src-main-resource folders added.

Bingo.. run the app and it should be fine.

like image 45
Scrimmers Avatar answered Dec 30 '22 15:12

Scrimmers