Search code examples
maventomcatmaven-tomcat-plugin

Tomcat maven plugin - what's the difference between run-war and run-war-only


Something of a maven noob, I'm trying to understand the difference between

tomcat:run-war

and

tomcat:run-war-only

The Apache documentation mean very little to someone unfamiliar with the environment:

tomcat7:run-war Runs the current project as a packaged web application using an embedded Tomcat server.
tomcat7:run-war-only Runs the current project as a packaged web application using an embedded Tomcat server without forking the package cycle.

What is the difference in layman's terms?


Solution

  • tomcat7:run-war-only target will run the tomcat in the same process (shell). If you terminate the shell, the tomcat will die and the webapp is not available anymore

    tomcat7:run-war will launch the war in 'background'. Maven will finish the job and you'll be able to reuse the shell. Webapp will still be available