如何使用Maven Cargo插件将Web应用程序包(WAB、OSGI和JavaEE)部署到Glassfish 3.x中

如何使用Maven Cargo插件将Web应用程序包(WAB、OSGI和JavaEE)部署到Glassfish 3.x中,maven,glassfish,osgi,cargo,wab,Maven,Glassfish,Osgi,Cargo,Wab,我正在尝试使用Maven Cargo插件部署一组OSGI捆绑包和一个混合应用程序。war(使用OSGI的Restservice Web应用程序)也称为Web应用程序捆绑包(或WAB)(例如,请参阅) 将OSGI捆绑包部署到Glassfish 3.1.x中效果很好,但我还没有找到部署Web应用程序捆绑包的方法 它的包装是“war”,但我必须将其作为OSGI包进行部署。那我怎么才能告诉这个货物插件呢 我尝试使用的maven配置: <plugin> <groupId>

我正在尝试使用Maven Cargo插件部署一组OSGI捆绑包和一个混合应用程序。war(使用OSGI的Restservice Web应用程序)也称为Web应用程序捆绑包(或WAB)(例如,请参阅)

将OSGI捆绑包部署到Glassfish 3.1.x中效果很好,但我还没有找到部署Web应用程序捆绑包的方法

它的包装是“war”,但我必须将其作为OSGI包进行部署。那我怎么才能告诉这个货物插件呢

我尝试使用的maven配置:

  <plugin>
    <groupId>org.codehaus.cargo</groupId>
    <artifactId>cargo-maven2-plugin</artifactId>
    <version>1.4.0</version>
    <configuration>
      <wait>false</wait>

      <container>
        <containerId>glassfish3x</containerId>
        <home>${glassfish.home}</home>
        <type>installed</type>
      </container>
      <configuration>
        <type>existing</type>
        <home>${glassfish.home}</home>
        <properties>
          <cargo.hostname>localhost</cargo.hostname>
          <cargo.rmi.port>4848</cargo.rmi.port>
          <cargo.domain.name>${glassfish.domain}</cargo.domain.name>
        </properties>
      </configuration>
      <deployables>
        <deployable>
          <groupId>com.acme.rest</groupId>
          <artifactId>rest-api</artifactId>
          <type>bundle</type>
        </deployable>
      </deployables>
    </configuration>
  </plugin>

org.codehaus.cargo
cargo-maven2-plugin
1.4.0
假的
玻璃鱼3X
${glassfish.home}
安装
现有的
${glassfish.home}
本地服务器
4848
${glassfish.domain}
com.acme.rest
RESTAPI
捆
但出现以下错误:

[错误]未能在项目rest api上执行目标org.codehaus.cargo:cargo-maven2-plugin:1.4.0:重新部署(默认cli):工件[com.acme.rest:rest api:bundle]不是项目的依赖项。->[帮助1] org.apache.maven.lifecycle.LifecycleExecutionException:未能在项目rest api:Artifact[com.acme.rest:rest api:bundle]上执行目标org.codehaus.cargo:cargo-maven2-plugin:1.4.0:redeploy(默认cli)不是项目的依赖项

作为组件类型“web”部署是可行的,但是我不能使用OSGI捆绑包


有人有部署Web应用程序包和OSGI包的经验吗?

我不知道cargo插件,但要使用asadmin客户端部署wab,必须通过--type=OSGI选项,如下所示:

asadmin部署——type=osgi foo.war

所以,看看是否可以配置cargo插件来传递这个选项

Sahoo的诀窍是:

<deployable>
  <groupId>com.acme.rest</groupId>
  <artifactId>rest-api</artifactId>
  <type>war</type>
  <implementation>org.codehaus.cargo.container.deployable.Bundle</implementation>
</deployable>

com.acme.rest
RESTAPI
战争
org.codehaus.cargo.container.deployable.Bundle

您仍然有一个WAR工件,但Bundle会欺骗Cargo将其部署为OSGi。

尝试使用版本
1.4.7
,该版本增加了对发送
asadmin
参数以及@Sahoo提到的参数的支持

<cargo.glassfish.deploy.arg.1>--type=osgi foo.war</cargo.glassfish.deploy.arg.1>
--type=osgi foo.war
允许为glassfish部署传递额外参数

您的回答是对的,但问题是如何传递此参数!通过分析货源,我发现,当模块的包装类型为“bundle”时,类型设置为“osgi”,但在混合应用程序中,包装类型为“war”。