1

I recenly released a new final version of a XaaS framework. One part of the framework is a webapplication for translation issues.

The idea is to keep the webapplication compatible to the framework. That means on every new release the released webapplication must be deployed.

To release a version i am using

mvn release:prepare release:perform

What works great.

In this command we have 3 differernt versions,

  • the previous version, (i.e. 1.9-SNAPSHOT)
  • the releasename-version, (i.e. 1.9-FINAL)
  • the next deveopment version (i.e. 2.0-SNAPSHOT)

How to deploy the xxx-1.9-FINAL.war and xxx-2.0-SNAPSHOT.war using scp?

Some important benefits:

  1. If the war could not be scped the release shall fail.
  2. If the release fail, the war should not be deployed.
  3. The pom.xml must contain a container-version.
Grim
  • 1,938
  • 10
  • 56
  • 123

2 Answers2

1

release:perform would also deploy the released version (1.9-FINAL in your case). How exactly is the artefact deployed is controlled by the settings of the maven deploy plugin (the transport can be set to scp). A detailed explanation can be found here: http://maven.apache.org/plugins/maven-deploy-plugin/examples/deploy-ssh-external.html

Hope that answers your question. As for the points in your question:

If the war could not be scped the release shall fail. In this situation only the perform part of the command will fail.

If the release fail, the war should not be deployed. This is somehow out of the box.

The pom.xml must contain a container-version. Not sure i understand what you mean.

  • By container-version i meant that the `pom.xml` should configure what webappcontainer must deployed to, in example `tomcat-7.0.32` or `glassfish` or `jboss5`. Actually you gave no config-sample for the `scp-command` – Grim Jul 11 '16 at 05:44
  • By "on every new release the released webapplication must be deployed" you actually need to deploy the released version to an web container/application server? – Alexandru Marina Jul 11 '16 at 06:14
  • 1
    If this is the case, another option could be the use of maven exec plugin. With this you can run any command, like ssh, which could do anything. An example can be found in the first answer of this thread: http://stackoverflow.com/questions/12412519/run-remote-command-via-ssh-using-maven3 – Alexandru Marina Jul 11 '16 at 06:24
  • As for the web container to deploy you can use maven classifier. This will be appended to the artefact name with a "-" in front, you can set it by using different build profiles for each web container. Having it in the name you can also have it in the script mentioned above. – Alexandru Marina Jul 11 '16 at 06:28
0

This is not possible by design

There is no way to yield failed deployments to webcontainers.

Grim
  • 1,938
  • 10
  • 56
  • 123