4

我有主项目(projectA),它有一个库依赖(projectB),两者都有package.subpackage。我想在主项目中内联库。主要项目配置非常简单(除了“编译”范围列出的依赖项:

<plugin>
    <groupId>org.apache.felix</groupId>
    <artifactId>maven-bundle-plugin</artifactId>
    <version>2.4.0</version>
    <extensions>true</extensions>
    <configuration>
        <instructions combine.inherited="append">
            ...
            <Export-Package>package.*;version=${packet.version};-split-package:=merge-first</Export-Package>
            <Bundle-SymbolicName>${project.artifactId};singleton=true</Bundle-SymbolicName>
        </instructions>
    </configuration>
</plugin>       

然而它会产生以下警告

--- maven-bundle-plugin:2.4.0:bundle (default-bundle) @ projectA ---
Bundle project:projectA:bundle:version : Split package, multiple jars provide the same package:project/subproject
Use Import/Export Package directive -split-package:=(merge-first|merge-last|error|first) to get rid of this warning
Package found in   [Jar:., Jar:subproject]
Class path         [Jar:., Jar:subproject]

我有拆分包指令,但警告仍然存在。

我希望它是一种简单地内联显式列出的工件中的所有内容的方法,仅此而已(即使声明了更多依赖项),没有任何传递依赖项。最好没有关于拆分包的任何警告。

4

1 回答 1

-1

我认为你需要maven shade插件

于 2014-02-14T14:59:15.447 回答