Pawan
Pawan

Reputation: 32331

How to deploy a Maven Project from Eclipse IDE to Tomcat Server

I have created a New Other --->Maven Project from Eclipse IDE and added Archetpe as org.apache.maven.archetypes --- maven-archetype-webapp and provided these values

Group Id : com.mypack Artifact Id : MYWEBAPP version : 0.0.1-SNAPSHOT package : com.mypack

Then from the command Prompt ,Went to that POM.xml directory ,and i have done these things

mvn clean mvn install mvn eclipse:eclipse

In all these cases the BUILD SUCCESSFUL came

Then from the Eclipse , i added the server Tomcat and wanted to install these MYWEBAPP to the server , but a popup appeared saying

There are no resources that can be added or removed from the Server .

Please tell me if this is the correct procedure or not .

Upvotes: 1

Views: 1311

Answers (1)

Jeen Broekstra
Jeen Broekstra

Reputation: 22052

A maven webapp unfortunately has a slightly different layout from an Eclipse webapp (WTP) project. The easiest way to get them to play nice together is do specify the wtpversion parameter for the maven-eclipse plugin. This will ensure that when the Eclipse project settings are generated, it includes WTP settings, making your project a valid Eclipse webapp project which you can run directly from Eclipse.

Like so:

mvn -Dwtpversion=1.0 eclipse:eclipse

Upvotes: 1

Related Questions