简体   繁体   English

在已经自动加载的战争中,将Maven Cargo部署到远程JONAS失败

[英]Maven Cargo deployment to remote JONAS fails on already autoloaded war

Here is the sequence of actions that leads to deployment failure : 这是导致部署失败的操作序列:

  • I deploy for the first time a war called xxx.war, through Cargo, to a remote JONAS 4.7.4. 我第一次通过货运将名为xxx.war的战争部署到远程JONAS 4.7.4。 It succeeds, and put my war in webapps directory. 它成功了,把我的战争放在了webapps目录中。
  • I try to redeploy this war through Cargo to update it : no problem, it succeeds. 我试图通过货运重新部署这场战争以更新它:没问题,它成功了。
  • I shutdown JONAS and start it. 我关闭JONAS并启动它。 My JONAS is configured to autodeploy war that are in webapps directory. 我的JONAS已配置为自动部署webapps目录中的war。 So my xxx.war is automatically deployed by JONAS. 所以我的xxx.war由JONAS自动部署。
  • I try to redeploy a new version of this war through Cargo : this is a failure. 我尝试通过货运重新部署这场战争的新版本:这是失败的。 When a war has been autodeployed by JONAS, I just can't redeploy it by Maven Cargo. JONAS自动部署了战争后,我无法通过Maven Cargo重新部署它。

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. 如果JONAS不在自动部署模式下,则在重新启动JONAS之后,通过货运重新部署战争的新版本没有问题。

Any ideas ? 有任何想法吗 ?

Finally I don't use cargo anymore. 最后,我不再使用货物了。

Instead I do deployment through antrun plugin, and it works very well. 相反,我通过antrun插件进行部署,并且效果很好。

I have put JONAS in autodeploy mode. 我已将JONAS置于自动部署模式。

        <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>        

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM