2

Maven Cargo Plugin を使用して、一連の OSGI バンドルと、Web アプリケーション バンドル (または WAB) とも呼ばれるハイブリッド アプリケーション .war (OSGI を使用する Restservice を使用した Web アプリケーション) をデプロイしようとしています (たとえば、https://glassfish. java.net/public/GF-OSGi-Features.pdf )。

Glassfish 3.1.x への OSGI バンドルのデプロイは正常に機能しますが、Web アプリケーション バンドルをデプロイする方法が見つかりません。

パッケージは「戦争」ですが、OSGIバンドルとして展開する必要があります。では、どうすればこれを Cargo Plugin と言うことができるでしょうか?

私が使用しようとした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>

しかし、次のエラーが表示されます。

[エラー] プロジェクト rest-api で目標 org.codehaus.cargo:cargo-maven2-plugin:1.4.0:redeploy (default-cli) を実行できませんでした: Artifact [com.acme.rest:rest-api:bundle] はプロジェクトの依存関係ではありません。-> [ヘルプ 1] org.apache.maven.lifecycle.LifecycleExecutionException: プロジェクト rest-api で目標 org.codehaus.cargo:cargo-maven2-plugin:1.4.0:redeploy (default-cli) を実行できませんでした: Artifact [ com.acme.rest:rest-api:bundle] はプロジェクトの依存関係ではありません。

コンポーネント タイプ「web」としてのデプロイは機能しますが、OSGI バンドルを使用できません...

Web アプリケーション バンドルと OSGI バンドルをデプロイした経験のある人はいますか?

4

3 に答える 3

0

@Sahooが言及したパラメーターと組み合わせてパラメーター1.4.7を送信するためのサポートを追加したバージョンを使用してみてください。asadmin

<cargo.glassfish.deploy.arg.1>--type=osgi foo.war</cargo.glassfish.deploy.arg.1>

グラスフィッシュのデプロイに追加のパラメーターを渡すことを許可する https://jira.codehaus.org/browse/CARGO-1245

于 2014-02-21T03:00:57.430 に答える
0

トリックは次のとおりです。

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

WAR アーティファクトはまだありますが、Bundle は Cargo をだまして OSGi としてデプロイさせます。

于 2013-07-14T00:35:38.353 に答える