我正在使用maven-bundle-plugin
(bnd
有效)。
包含来自源的资源文件很简单。
例如,资源文件 ( ) 在构建期间src/main/resources/some.xml
移动到target
目录 ( target/classes/some.xml
) 下,并且可以使用<Include-Resource>
指令将其包含到包中:
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>3.0.1</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Include-Resource>
some.xml=target/classes/some.xml,
</Include-Resource>
</instructions>
</configuration>
</plugin>
让我们有一个依赖:
<dependency>
<groupId>com.example</groupId>
<artifactId>library</artifactId>
<version>1.0.0</version>
</dependency>
如何引用依赖内的资源文件jar
?
换句话说,如何
指定如下内容:
com.example:library:1.0.0:jar/some.xml
而不是这个:
target/classes/some.xml
所以来自依赖项之一的资源出现在输出包中jar
?