Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 419
StackExchange What The Heck Avatar asked Aug 01 '13 13:08

StackExchange What The Heck


2 Answers

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

like image 118
WeMakeSoftware Avatar answered Oct 12 '22 20:10

WeMakeSoftware


tomcat7:run-war run the lifecycle to package your war then run this war in an embeded tomcat

tomcat7:run-war-only won't build your war. Try mvn clean then mvn tomcat7:run-war-only and you will see the difference.

like image 36
Olivier Lamy Avatar answered Oct 12 '22 21:10

Olivier Lamy