4

私はservicemix(v4.5.3)を使用しており、maven-bundle-pluginを介してバンドルとしてアプリケーション(数百のサードパーティライブラリに依存)をデプロイしたいと考えています。

以下は私のpom.xmlです

<plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>2.3.7</version>
                <extensions>true</extensions>
                <executions>
                       <execution>
                            <id>wrap-my-dependency</id>
                            <goals>
                                <goal>wrap</goal>
                            </goals>
                            <configuration>
                                 <wrapImportPackage></wrapImportPackage>
                                 <instructions>

                                        <Include-Resource>{maven-resources}</Include-Resource>
                                        <Bundle-ClassPath>.</Bundle-ClassPath>
                                        <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
                                        <Embed-Transitive>true</Embed-Transitive> 
                                        <Import-Package>*</Import-Package>
                                        <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
                                        <Bundle-Name>${project.artifactId}</Bundle-Name>
                                        <Bundle-Version>1.0.0</Bundle-Version>
                                        <Bundle-Activator>com.bundle.example.Main</Bundle-Activator>

                                </instructions>
                             </configuration>
                      </execution>
                </executions>

            </plugin>

これに従ってバンドルを作成しましたが、mvn bundle:wrapを実行すると、外部 jar がバンドルに変換され、プロジェクトの target/classes フォルダーに配置されます。

さて、私の質問は、アプリケーションを実行するために、すべてのバンドルをコピーし、servicemix インストール ディレクトリの deploy フォルダーに配置する必要があるかどうかです。私はこのアプローチに従いましたが、それでもアプリケーションの起動中にエラーが発生します。

マニフェスト ファイル:

    Imported Packages

    com.dhtmlx.connector from dhtmlxgridConnector (476)
    com.google.gson,version=[1.7,2) -- Cannot be resolved
    com.googlecode.ehcache.annotations,version=[1.1,2) -- Cannot be resolved
    com.hazelcast.core,version=[2.6,3) from com.hazelcast (437)
    com.tinkerpop.blueprints -- Cannot be resolved
    com.tinkerpop.blueprints.impls.orient -- Cannot be resolved
    com.tinkerpop.frames -- Cannot be resolved

これは、バンドルのマニフェスト ファイルのほんの一部です。ここでは、バンドルを開始するための問題と思われるいくつかのバンドルがまだ解決されていません。

そして 2 番目のクエリ: maven-bundle-plugin を使用しているときに、すべてのサードパーティ ライブラリを処理するためのより良い方法はありますか。貴重な提案を待っています。

4

1 に答える 1