Maven2: hot plug-in deployment and Jonas support

I am trying to connect the Cargo plugin to my maven project to benefit from a hot war deployment aimed at the Jonas server.

The official documentation is not entirely clear for 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 alignment for my military 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 

in my project, the war is copied to the Jonas webapps folder, but there is no hot deployment. The file is copied only, but the Jonas hot command is not called, so my modifications are not available right away.

EDIT: I also tried adding the deployment configuration as suggested in the answers, but the behavior is the same (i.e. the war is copied, but the Jonas hot deploy command is not called so that the war does not restart in Jonas).

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

Thanks in advance!

+4
source share
1 answer

The deployment load page in the running container is linked to the table , which lists the versions in which the hot deployment was proposed for this container. According to the table, JOnAS 4.x is supported since version 1.0 (which you are using), so it should work.

This page also has some recommendations for configuring the plugin for deployment, I tried to interpret them below.

From the home element in your configuration, I assume that you are trying to deploy locally. The configuration on the container launch page implies that the hot deployment should be automatic at this line at the end:

Just enter mvn-load: expand. Please note that we did not specify any item, not one. This is because the plugin is smart enough to create default instances for you. Cool, right?

However, an earlier configuration block indicates that you must configure the deployer section to make a war deployment plugin. The configuration for the deployment will 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 does not work for you, consider declaring a configuration for your war.

+1
source

All Articles