我正在创建自定义的jira插件,并且一切正常,直到将一个依赖项添加到插件pom.xml中。添加依赖项(使用范围编译)后,我得到
org.osgi.framework.BundleException: Unresolved constraint in bundle <my.bundle>
即使插件代码中未使用依赖项,我也会收到此异常。该插件是使用target / classes /中的依赖关系构建的。我不明白,问题可能出在哪里。
我发现了有关该异常的更多详细信息
[c.a.p.osgi.factory.OsgiPlugin] Detected an error (BundleException)
enabling the plugin 'cz.bios.jrt' : Unresolved constraint in bundle cz.bios.jrt [213]:
Unable to resolve 213.0: missing requirement
[213.0] osgi.wiring.package; (osgi.wiring.package=org.apache.avalon.framework.logger)
似乎我缺少org.apache.avalon.framework.logger包,对吗?
答案 0 :(得分:3)
解决方案是像这样在插件pom.xml中导出那些缺少的软件包:
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-jira-plugin</artifactId>
<version>${amps.version}</version>
<extensions>true</extensions>
<configuration>
<productVersion>${jira.version}</productVersion>
<productDataVersion>${jira.version}</productDataVersion>
<enableQuickReload>true</enableQuickReload>
<enableFastdev>false</enableFastdev>
<instructions>
<Atlassian-Plugin-Key>${atlassian.plugin.key}</Atlassian-Plugin-Key>
<Export-Package>cz.bios.jrt,cz.bios.jira,org.apache.avalon.framework.logger,org.apache.log,com.atlassian.inject,com.sun.xml.fastinfoset.sax</Export-Package>
<Import-Package>org.springframework.osgi.*;resolution:="optional", org.eclipse.gemini.blueprint.*;resolution:="optional", *</Import-Package>
<Spring-Context>*</Spring-Context>
</instructions>
</configuration>
</plugin>