London
London

Reputation: 15274

Maven tomcat plugin

is it possible to run spring mvc application on tomcat(with this plugin http://mojo.codehaus.org/tomcat-maven-plugin/) if yes, where is the application log and deploy web app directory located ?

Let me rephrase the question. I'm asking for some way to start my web app(spring mvc application) from a command line, either with maven or with something inside application that creates web server.

What would you recommend? I found this tomcat maven plugin while googling, no special reason to use it

Currently I use jboss server for this application, but I want to run both server and application from application,any suggestions?

Upvotes: 0

Views: 2669

Answers (3)

Raghuram
Raghuram

Reputation: 52625

If I understand your question correctly, from your application you want to start tomcat to serve a spring MVC application.

If so, you do not need maven or a maven plugin to do this. You can use tomcat catalina APIs to achieve this. Though dated, this article explains how.

As the other answers stated, maven's tomcat and cargo plugins allow you to start and stop tomcat from maven - typically to run some integration tests.

Upvotes: 0

shaunhusain
shaunhusain

Reputation: 19748

I'm not sure exactly why but we use the mvn cargo:start plugin instead, for testing locally when building with maven. We also utilize Spring and haven't had any issues regarding the mix. When starting up the Tomcat container with the command above it shows the following in the console

C:\SVN\myproject-war\target\tomcat6x\home>

This contains the webapps folder where the war is deployed and a logs folder.

Hope this helps, sorry I don't have direct experience with the tomcat-maven-plugin itself.

Upvotes: 0

crowne
crowne

Reputation: 8534

tomcat:run runs a web application in an embedded tomcat instance ... useful for testing during development.
See http://mojo.codehaus.org/tomcat-maven-plugin/run-mojo.html for listing of config parameters for the run goal, including warSourceDirectory which, if not specified defaults to ${basedir}/src/main/webapp

Upvotes: 1

Related Questions