Maven2: Cargo plugin hot deployment & Jonas support
Asked Answered
H

1

6

I am trying to get the Cargo plugin works on my maven project in order to benefit from war hot-deployment targetting the Jonas server.

The official documentation is not that clear on what is supported and what is not (for example you can find this: http://cargo.codehaus.org/Hot+Deployment but also this http://cargo.codehaus.org/JOnAS+4.x).

Anyway I have the following coniguration in for my war's POM:

<plugin>
    <groupId>org.codehaus.cargo</groupId>
    <artifactId>cargo-maven2-plugin</artifactId>
    <version>1.0</version>
    <configuration>
        <container>
            <containerId>jonas4x</containerId>
            <home>C:\JOnAS-4.8.4\nt\bin</home>
        </container>

        <configuration>
            <type>existing</type>
            <home>C:\JOnAS-4.8.4</home>
        </configuration>
    </configuration>
</plugin>

And when I run

mvn cargo:deploy

on my project, the war is copied to the Jonas webapps folder but there is no hot deployment. The file is only copied but the hot deploy Jonas command is not called so that my modifications are not available immediatly.

EDIT: I also tried to add a deployer configuration as suggested on the answers but the behaviour is the same (ie: war is copied but the Jonas hot deploy command is not called so that the war is not reloaded in Jonas).

Am I missing something or am I right saying the Cargo Maven plugin does not support Jonas Hot Deployement?

Thanks in advance!

Harkins answered 8/9, 2009 at 14:38 Comment(3)
per definition, no software, which is more like service than good, is clear. software is absolute 0 or 1 binary, clearing means 3, like straight math or classic logicCrusade
@LarsOn: sorry I don't understand your comment... or even the sentence..Harkins
@Harkins : i am facing a similar issue with jboss instead of Jonas, were you able to get some lead ?Immunity
C
1

The cargo page on deploying to a running container links to a table listing the version where hot deployment was introduced for that container. According to the table, JOnAS 4.x is supported from version 1.0 (which you are using), so it should work.

On that page it also has some guidelines for configuring the plugin for deployment, I've attempted to interpret them below.

From the home element in your configuration I assume you are attempting a local deployment. The configuration in the running container page implies that the hot-deployment should be automatic in this line at the end:

Just type mvn cargo:deploy. Notice that we haven't specified a element nor a one. This is because the plugin is smart enough to create default instances for you. Cool, isn't it?

However the earlier configuration block indicates you should configure the deployer section to make the cargo plugin aware of the war to be deployed. The configuration for the deployer would be something like this:

<deployer>
  <type>local</type>
  <deployables>
    <deployable>
      <groupId>${project.groupId}</groupId>
      <artifactId>${project.artifactId}</artifactId>
      <type>war</type>
      <properties>
        <context>optional root context</context>
      </properties>
      <pingURL>optional url to ping to know if deployable is done or not</pingURL>
      <pingTimeout>optional timeout to ping (default 20000 milliseconds)</pingTimeout>
    </deployable>
  </deployables>
</deployer>

If the automatic option isn't working for you, consider declaring the configuration for your war.

Cockeye answered 13/9, 2009 at 13:9 Comment(2)
Thanks for your answer. I added the deployer section in my configuration and it did not change anything. Actually the problem is that my war is copied to the good Jonas directory but it seems that the plugin does not call the hot deployment Jonas command (jonas admin -a my_war). So I have my war copied but not properly hot deployed.Harkins
that solution helped me, sorry it didn't solve your original problem.Partan

© 2022 - 2024 — McMap. All rights reserved.