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

2

7

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?

Fong answered 1/8, 2013 at 13:35 Comment(0)
C
11

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

Clank answered 1/8, 2013 at 13:41 Comment(3)
Use run-war-only to keep control of when tomcat is started and stopped.Clank
@Funtik - such as for Integration testing?Stoffel
@djangofan, yes for exampleClank
F
5

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.

Fiddling answered 2/8, 2013 at 0:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.