【问题标题】:Error trying to OSGi wrap (embed) jaxb-xjc with maven-bundle-plugin, bnd,尝试使用 maven-bundle-plugin、bnd、OSGi 包装(嵌入)jaxb-xjc 时出错
【发布时间】:2016-10-03 16:03:33
【问题描述】:

我正在尝试将以下 jar(以及其他)嵌入到 OSGi 包中。

<dependency>
    <groupId>com.sun.xml.bind</groupId>
    <artifactId>jaxb-xjc</artifactId>
    <version>2.1.13</version>
</dependency>

maven-bundle-plugin 与 Classes found in the wrong directory: {1.0/com/sun/codemodel/util/Surrogate$Parser.class=com.sun.codemodel.util.Surrogate$Parser, ...many more of these...} 的以下设置错误,因为这个 jar 在 jar 的根目录下名为 1.0 的文件夹中有一堆类文件作为资源,这会将其丢弃。我该如何解决这个问题?

       <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <version>3.0.0</version>

            <configuration>
                <instructions>
                    <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
                    <Embed-Transitive>true</Embed-Transitive>
                    <Export-Package>a.single.package.i.want.to.export</Export-Package>
                    <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                </instructions>
            </configuration>
        </plugin>

【问题讨论】:

    标签: osgi apache-felix bnd maven-bundle-plugin


    【解决方案1】:

    我有同样的问题。看来我在 pom.xml 中有两个冲突的版本。通过排除其中一个版本,我可以解决问题。

    <dependency>
        <groupId>uk.ac.ebi.chebi.webapps.chebiWS.client</groupId>
        <artifactId>chebiWS-client</artifactId>
        <version>2.2.2</version>
        <exclusions>
            <exclusion>
                <groupId>com.sun.xml.ws</groupId>
                <artifactId>jaxws-tools</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    

    【讨论】:

      猜你喜欢
      • 2011-03-06
      • 2010-11-25
      • 2012-04-20
      • 2010-11-19
      • 2012-08-31
      • 2020-03-02
      • 2016-07-20
      • 2016-09-21
      • 2016-11-09
      相关资源
      最近更新 更多