Search code examples
javamavenglassfishcargo

Java EE war deployment or redeployment - automatically choose the appropriate action


In development, it's fairly common to want to deploy your war to your local app server, irrespective of whether it's already deployed (i.e. just deploy over the old version, if it's there).

However both cargo and the glassfish maven plugin fail under the following circumstances:

  • 'redeploy', if war is not already deployed,
  • 'deploy', if it's already deployed.

As a developer, I don't want to have to choose one or the other. Is there a single command that will enable deployment to succeed in both use cases?


Solution

  • cargo:redeploy now works as expected in cargo 1.1.3 (at least with glassfish)