Maven2:货运插件热部署和乔纳斯支持 [英] Maven2: Cargo plugin hot deployment & Jonas support

查看:111
本文介绍了Maven2:货运插件热部署和乔纳斯支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在我的Maven项目中使用Cargo插件,以便从针对Jonas服务器的战争热部署中受益.

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.

关于支持什么和不支持什么的官方文档尚不清楚(例如,您可以找到以下内容: http://cargo.codehaus.org/JOnAS+4.x ).

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

无论如何,对于战争的POM,我有以下含义:

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>

当我跑步时

mvn cargo:deploy

在我的项目中,战争被复制到Jonas webapps文件夹,但是没有热部署.仅复制该文件,但不调用hot deploy Jonas命令,因此无法立即使用我的修改.

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.

我也尝试按照答案中的建议添加部署程序配置,但是行为是相同的(即:复制了war,但未调用Jonas hot deploy命令,以便不会在Jonas中重新加载war).

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

我是否缺少某些信息?还是我说的是Cargo Maven插件不支持Jonas Hot Deployement?

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

提前谢谢!

推荐答案

,其中列出了热部署的版本是为该容器引入的.根据该表,版本1.0(您正在使用)支持JOnAS 4.x,因此它应该可以工作.

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.

在您配置的home元素中,我假设您正在尝试本地部署.正在运行的容器页面中的配置意味着热部署应该在此行的最后自动进行:

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:

MVN货物类型:部署.注意,我们没有指定元素也没有指定一个.这是因为该插件足够智能,可以为您创建默认实例.不错,不是吗?

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?

但是,前面的配置块指示您应该配置deployer部分,以使cargo插件知道要部署的战争.部署者的配置应如下所示:

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.

这篇关于Maven2:货运插件热部署和乔纳斯支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆