Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why run tomcat7:deploy vs tomcat7:redeploy?

Is there any reason to ever run tomcat7:deploy instead of tomcat7:redeploy? So far, I haven't found anything the deploy can do that the redeploy can't, however, a deploy only fails if the app is deployed already, which needs a redeploy. The redeploy works even after you tomcat7:undeploy the app, which should revert it to the most initial stage.

Why does tomcat7:deploy exist beside the redeploy which seems to do everything it does plus more?

I am using

<plugin>
    <groupId>org.apache.tomcat.maven</groupId>
    <artifactId>tomcat7-maven-plugin</artifactId>
    <version>2.2</version>
</plugin>
like image 558
amphibient Avatar asked Aug 30 '26 04:08

amphibient


1 Answers

I took a look at the source code, it seems that the only difference is that deploy performs a check to see if the project is already deployed. If it is, the deployment fails. redeploy will undeploy instead if it finds an already deployed application.

So I don't think deploy is all that useful. I can see how it makes sense to use it if for some reason your application can't be hot-reloaded and requires some different process to be taken down. In that case, it would make sense to prefer deploy over redeploy.

like image 127
sirolf2009 Avatar answered Sep 01 '26 14:09

sirolf2009



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!