mavencargoautodeployjonas

Maven Cargo deployment to remote JONAS fails on already autoloaded war


Here is the sequence of actions that leads to deployment failure :

If JONAS is not in autodeploy mode, there is no problem in redeploying a new version of the war through Cargo after a restart of JONAS.

Any ideas ?


Solution

  • Finally I don't use cargo anymore.

    Instead I do deployment through antrun plugin, and it works very well.

    I have put JONAS in autodeploy mode.

            <plugin>
             <artifactId>maven-antrun-plugin</artifactId>
             <configuration>
                <tasks>
                    <scp 
                        file="${project.basedir}/target/${war.warName}.war"
                        todir="${scp.finalDir}" 
                        trust="true" 
                        failonerror="true"/>
                </tasks>
             </configuration>
             <executions>
                    <execution>
                          <id>copy-war-to-server</id>
                          <phase>install</phase>
                          <goals>
                                 <goal>run</goal>
                          </goals>
                    </execution>
             </executions>
           <dependencies>
          <dependency>
            <groupId>ant</groupId>
            <artifactId>ant-jsch</artifactId>
            <version>1.6.5</version>
          </dependency>
          <dependency>
            <groupId>com.jcraft</groupId>
            <artifactId>jsch</artifactId>
            <version>0.1.42</version>
          </dependency>
        </dependencies>
       </plugin>