Redeploying to running conainer with maven2 - is there a better way?

View: New views
2 Messages — Rating Filter:   Alert me  

Redeploying to running conainer with maven2 - is there a better way?

by pisajew :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello

I'm using cargo to deploy EAR to geronimo. I wanted to do "mvn
install" in the main directory of multimodule project and to have the
EAR module deployed as the result. So I bound cargo to install phase
in the pom.xml for EAR module, like this:

  <plugin>
  <groupId>org.codehaus.cargo</groupId>
  <artifactId>cargo-maven2-plugin</artifactId>
  <version>1.0</version>
  <configuration>
  <container>
  <containerId>geronimo1x</containerId>
  <home>/usr/local/geronimo-jetty6-javaee5-2.1.4</home>
  </container>
  </configuration>
  <executions>
  <execution>
  <id>redeploy</id>
  <phase>install</phase>
  <goals>
  <goal>undeploy</goal>
  <goal>deploy</goal>
  </goals>
  </execution>
  </executions>
  </plugin>


This works well, if the application is deployed to server before doing
"mvn install". This does not need to be always true and if it's not
maven stops because it fails to undeploy the app. In such case I would
like to skip "undeploy" goal but run the "deploy" task. Is there any
way to configure cargo plugin so it will not report failure to maven
if it fails to undeploy the application? Or maybe there is a better
way to achieve what I want?

Regards,

Piotr

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Redeploying to running conainer with maven2 - is there a better way?

by Ritesh Trivedi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I had the same issue and I got around that by using cargo:redeploy mojo instead of separate undeploy and deploy.

HTH

pisajew wrote:
Hello

I'm using cargo to deploy EAR to geronimo. I wanted to do "mvn
install" in the main directory of multimodule project and to have the
EAR module deployed as the result. So I bound cargo to install phase
in the pom.xml for EAR module, like this:

  <plugin>
  <groupId>org.codehaus.cargo</groupId>
  <artifactId>cargo-maven2-plugin</artifactId>
  <version>1.0</version>
  <configuration>
  <container>
  <containerId>geronimo1x</containerId>
  <home>/usr/local/geronimo-jetty6-javaee5-2.1.4</home>
  </container>
  </configuration>
  <executions>
  <execution>
  <id>redeploy</id>
  <phase>install</phase>
  <goals>
  <goal>undeploy</goal>
  <goal>deploy</goal>
  </goals>
  </execution>
  </executions>
  </plugin>


This works well, if the application is deployed to server before doing
"mvn install". This does not need to be always true and if it's not
maven stops because it fails to undeploy the app. In such case I would
like to skip "undeploy" goal but run the "deploy" task. Is there any
way to configure cargo plugin so it will not report failure to maven
if it fails to undeploy the application? Or maybe there is a better
way to achieve what I want?

Regards,

Piotr

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email