java - How to include Maven dependencies in Manifest file -
i developing plugin osgi application, using maven compile. in order install plugin, osgi application should read information plugin dependencies. information should provided in manifest.mf file. i'm wondering how use virgo tooling generate proper manifest.mf file.
these dependencies include in manifest.mf
update according answer used apache felix
to pom.xml have added
<plugin> <artifactid>maven-jar-plugin</artifactid> <configuration> <archive> <manifestfile>${project.build.outputdirectory}/meta-inf/manifest.mf</manifestfile> </archive> </configuration> </plugin> <plugin> <groupid>org.apache.felix</groupid> <artifactid>maven-bundle-plugin</artifactid> <executions> <execution> <id>bundle-manifest</id> <phase>process-classes</phase> <goals> <goal>manifest</goal> </goals> </execution> </executions> </plugin>
downloaded maven-bundle.jar , executed command mvn org.apache.felix:maven-bundle-plugin:manifest
produced .jar file manifest, manifest contained following infromation
manifest-version: 1.0 implementation-vendor: apache software foundation implementation-title: maven bundle plugin implementation-version: 3.2.0 implementation-vendor-id: org.apache.felix built-by: cziegeler build-jdk: 1.7.0_80 specification-vendor: apache software foundation specification-title: maven bundle plugin created-by: apache maven 3.3.9 specification-version: 3.2.0 archiver-version: plexus archiver
any ideas did wrong?
personally, generate manifest.mf file apache felix maven bundle plugin
try add configuration plugin in project's pom.xml file.
here's start, should read documentation , find correct instructions fit precise need. helpful if provide example of manifest.mf file.
<plugin> <groupid>org.apache.felix</groupid> <artifactid>maven-bundle-plugin</artifactid> <version>3.2.0</version> <extensions>true</extensions> <configuration> <instructions> <embed-dependency>*;scope=compile|runtime;inline=false</embed-dependency> </instructions> </configuration> <executions> <execution> <id>generate-manifest</id> <goals> <goal>manifest</goal> </goals> <phase>generate-resources</phase> </execution> </executions> </plugin>
with kind of config, manifest.mf generated during 'generate-resources' phase.
Comments
Post a Comment