「maven-bundle-plugin」を使用してOSGiバンドルを作成しました(「jruby-complete-1.4.0.jar」をosgiバンドルとして作成しようとしています。依存関係のみが「jruby-complete-1.4.0.jar」であることに注意してください"..diag コマンド (#diag XX) を使用して osgi コンソール経由でバンドルを確認すると、いくつかのパッケージが見つからないと表示されます。
osgi> diag 51
reference:file:dropins/jruby-complete-1.4.0.wso2v1.jar [51]
Direct constraints which are unresolved:
Missing optionally imported package com.sun.mirror.apt_0.0.0.
Missing optionally imported package com.sun.mirror.declaration_0.0.0.
Missing optionally imported package com.sun.mirror.type_0.0.0.
Missing optionally imported package com.sun.mirror.util_0.0.0.
Missing optionally imported package org.apache.bsf.util_0.0.0.
Missing optionally imported package org.jgrapht_0.0.0.
Missing optionally imported package org.jgrapht.graph_0.0.0.
Missing optionally imported package sun.misc_0.0.0.
私のポンはこんな感じです。
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Name>${project.artifactId}</Bundle-Name>
<Export-Package>
com.kenai.*,
com.sun.jna.*,
org.jruby.*,
org.joni.*,
</Export-Package>
<Import-Package>
*;resolution:=optional
</Import-Package>
<Fragment-Host>bsf-all</Fragment-Host>
<DynamicImport-Package>*</DynamicImport-Package>
<Embed-Dependency>*;scope=compile|runtime;inline=true;</Embed-Dependency>
</instructions>
</configuration>
</plugin>
<Import-Package>
それで、 pom [2]のように「オプションの不足しているパッケージ」をオプションに追加しようとしましたが、次のような問題がさらに発生します。
ference:file:dropins/jruby-complete-1.4.0.wso2v1.jar [51]
Constraints from the fragment conflict with the host: Import-Package: *; version="0.0.0"
Constraints from the fragment conflict with the host: Import-Package: com.sun.mirror.apt; version="0.0.0"
Constraints from the fragment conflict with the host: Import-Package: com.sun.mirror.declaration; version="0.0.0"
Constraints from the fragment conflict with the host: Import-Package: com.sun.mirror.type; version="0.0.0"
Constraints from the fragment conflict with the host: Import-Package: com.sun.mirror.util; version="0.0.0"
Constraints from the fragment conflict with the host: Import-Package: javax.management; version="0.0.0"
Constraints from the fragment conflict with the host: Import-Package: javax.script; version="0.0.0"
Constraints from the fragment conflict with the host: Import-Package: javax.swing.plaf.basic; version="0.0.0"
Constraints from the fragment conflict with the host: Import-Package: org.apache.bsf; version="0.0.0"
Constraints from the fragment conflict with the host: Import-Package: org.apache.bsf.util; version="0.0.0"
Constraints from the fragment conflict with the host: Import-Package: org.jgrapht; version="0.0.0"
Constraints from the fragment conflict with the host: Import-Package: org.jgrapht.graph; version="0.0.0"
Constraints from the fragment conflict with the host: Import-Package: org.jruby.anno; version="[1.4.0,2.0.0)"
Constraints from the fragment conflict with the host: Import-Package: org.jruby.exceptions; version="[1.4.0,2.0.0)"
Constraints from the fragment conflict with the host: Import-Package: org.jruby.runtime; version="[1.4.0,2.0.0)"
Constraints from the fragment conflict with the host: Import-Package: org.jruby.runtime.builtin; version="[1.4.0,2.0.0)"
Constraints from the fragment conflict with the host: Import-Package: sun.misc; version="0.0.0"
Direct constraints which are unresolved:
Missing imported package com.sun.mirror.apt_0.0.0.
Missing imported package com.sun.mirror.declaration_0.0.0.
Missing imported package com.sun.mirror.type_0.0.0.
Missing imported package com.sun.mirror.util_0.0.0.
Missing imported package org.apache.bsf.util_0.0.0.
Missing imported package org.jgrapht_0.0.0.
Missing imported package org.jgrapht.graph_0.0.0.
Missing optionally imported package org.jruby.anno_[1.4.0,2.0.0).
Missing optionally imported package org.jruby.exceptions_[1.4.0,2.0.0).
Missing optionally imported package org.jruby.runtime_[1.4.0,2.0.0).
Missing optionally imported package org.jruby.runtime.builtin_[1.4.0,2.0.0).
Missing imported package sun.misc_0.0.0.
pom.xml [2];
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Name>${project.artifactId}</Bundle-Name>
<Export-Package>
com.kenai.*,
com.sun.jna.*,
org.jruby.*,
org.joni.*,
</Export-Package>
<Import-Package>
com.sun.mirror.apt.*,
com.sun.mirror.declaration.*,
com.sun.mirror.type.*,
com.sun.mirror.util.*,
org.apache.bsf.util.*,
org.jgrapht.*,
org.jgrapht.graph.*,
sun.misc.*,
*;resolution:=optional
</Import-Package>
<Fragment-Host>bsf-all</Fragment-Host>
<DynamicImport-Package>*</DynamicImport-Package>
<Embed-Dependency>*;scope=compile|runtime;inline=true;</Embed-Dependency>
</instructions>
</configuration>
</plugin>
上記の問題をどのように克服できますか?他のバンドルに必要ないくつかのパッケージをエクスポートしています...ここで何か間違ったことをしていますか?