I'm using maven-bundle-plugin
(bnd
effectively).
It's straightforward to include a resource file from sources.
For example, a resource file (src/main/resources/some.xml
) is moved under target
directory (target/classes/some.xml
) during build time and can be included into the bundle using <Include-Resource>
instruction:
<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>
Let us have a dependency:
<dependency>
<groupId>com.example</groupId>
<artifactId>library</artifactId>
<version>1.0.0</version>
</dependency>
How to reference resource file inside dependent jar
?
In other words, how to
specify something like this:
com.example:library:1.0.0:jar/some.xml
instead of this:
target/classes/some.xml
so that resource from one of the dependency appeared in output bundle jar
?
jar
withsome.xml
taken from inside of another (dependency)jar
. Ultimately, this will be referenced by code, but before it can be referenced by code, it should be packaged into outputjar
. – Odyssey