Sunday, February 11, 2018

Difference between Apache Tomcat Maven Plugin run-war and run-war-only

Hi all,

According to the Apache Tomcat maven plugin documentation, the difference between the two goals are as following.

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

You can see the difference in each goal, if you first clean the target and execute each.

When  you execute tomcat7:run-war, it will run the package cycle again, build the war file and deploy it in the local tomcat instance. This should enable you to access the deployed service as needed.

But if you clean the target and execute tomcat7:run-war-only, then the package cycle won't run, only the tomcat will be started. You won't be able to access the web application using the URL.

Thank you.

Kinath.