maven auto deploy war to tomcat

Just go to the tomcat server’s conf/tomcat-users.xml, add:

<tomcat-users>

  <role rolename=”manager”/>

  <role rolename=”admin”/>

  <role rolename=”manager-gui”/>

  <user username=”admin” password=”password” roles=”admin,manager,manager-gui”/>

</tomcat-users>

 

And under the pom.xml’s plugins add:

<plugin>

                                <groupId>org.codehaus.mojo</groupId>

                                <artifactId>tomcat-maven-plugin</artifactId>

                                <configuration>

                                                <url>http://127.0.0.1:8080/manager/html</url>

                                                <username>admin</username>

                                                <password>password</password>

                                                <path>/cdip-dynoapp</path>

                                                <warFile>target/cdip-dynoapp.war</warFile>

                                </configuration>

                </plugin>

If you use tomcat 6, the url above should be http://127.0.0.1:8080/manager.

 

Then ,as usual:

mvn clean tomcat:redeploy

 

AUTO redeployed.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s