I am creating a dummy maven project with two modules, and I have included a general pom.xml file. I am able to build from the root pom.xml file and run all the tests but wh
I also had the same problem.Here is how I resolved.Though this is a late answer,I think this answer will hold true even today.
I am using tomcat7.The tomcat-maven-plugin:1.1 defaults to tomcat deployment url http://localhost:8080/manager/html
, but for tomcat 7 the url has changed to http://localhost:8080/manager/text
.
Step 1 : Find the url & role for tomcat to deploy war files.
I found that by manually going to
apache-tomcat-7.0.41\webapps\manager\WEB-INF\web.xml
The url used to deploy is : /text , so maven should use http://localhost:8080/manager/text
The role for this url is "manager-script"
Text Manager interface (for scripts)
/text/*
manager-script
Step 2 : Configure tomcat credentials for the role
So now we have found the URL to deploy the war and the role.If you havent configured tomcat users.Below is how to add the roles to apache-tomcat-7.0.41\conf\tomcat-users.xml.
Step 3: Configure tomcat-maven-plugin in pom.xml to use the tomcat url for deployment.
Now we need to configure tomcat-maven-plugin to use these.Below is my plugin configuration in the pom.xml.This will override the tomcat-maven-plugin's default tomcat deploy url.
org.codehaus.mojo
tomcat-maven-plugin
mytomcatserver
http://localhost:8080/manager/text
Step 4 : Configure maven's settings.xml for the tomcat url credentials.
Now for the maven plugin to deploy the war file to tomcat , it needs the username & password for your tomcat server. Find out settings.xml of maven is located ( mine was at apache-maven-3.2.3\conf ) and apply the below config to the
mytomcatserver
admin
admin
Step 5 : Moment of truth
Start tomcat.
mvn package ( war file created )
mvn tomcat:deploy ( watch tomcat console for the war deployment )
Your webapp will be available at http://localhost:8080/{context}