How to deploy/test a web application using tomcat-maven-plugin?


To quickly test your maven web application using an embedded tomcat instance, you just need to include this xml snippet in your Maven POM file,

<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<version>1.1</version>
<configuration>
<port>9999</port>
<path>/cxf</path>
<warFile>${project.basedir}/target/${project.build.finalName}.war</warFile>
</configuration>
</plugin>
</plugins>

and post compilation, execute the command: mvn tomcat:run. You can play around with the <port>, <path>, and <warFile> options as you need.

About these ads

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

Follow

Get every new post delivered to your Inbox.

Join 26 other followers

%d bloggers like this: