Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

deploying a war file in WTP(Eclipse) tomcat server

I have a maven build Java project. My war file name is: test-1.0-SNAPSHOT.war I am using M2E plugin in Eclipse. I have run target mvn package.

Added server as tomcat version 7 in eclipse indigo 3.7. Server started. But my war file didn't deployed in the server.

I have tried by right clicking tomcat server and Add remove..., it says "there is no resources that can be added or removed from the server".

How can i deploy my war file in the eclipse WTP tomcat server?. Do i need to run any maven target?

like image 607
TechFind Avatar asked Dec 03 '22 07:12

TechFind


1 Answers

Make sure that you have "Maven Integration for WTP" installed in your Eclipse instance.

First check if it's available through

  • Window->Preferences->Maven->Discovery->Open Catalog

If for whatever reason this does not work, you can get WTP integration from this update site (that's the version I am currently using):

https://repository.sonatype.org/content/repositories/forge-sites/m2eclipse-wtp/0.13.0/S/0.13.0.20110623-0455

This integration does a lifecycle mapping of maven-war-plugin into m2e architecture.

Once you've installed the WTP integration, you must restart eclipse and once it's restarted, right click on your web app project and choose: Maven->Update Project Configuration...

Also, I would advise to run a clean build at this time.

Last, but not least, delete and recreate your Tomcat server configuration (I don't know why, but I had to do it quite a few times when I switched to m2e).

like image 115
Alexander Pogrebnyak Avatar answered Jan 31 '23 18:01

Alexander Pogrebnyak