Ichwardort
Ichwardort

Reputation: 121

How to add a bundle manifest to an existing maven dependency?

I am using the Adobe XMP Core dependency within a maven file

<dependency>
    <groupId>com.adobe.xmp</groupId>
    <artifactId>xmpcore</artifactId>
    <version>5.1.2</version>
</dependency>

The MANIFEST.MF of that bundle is not suited for osgi deployment, as no bundle specific information was provided. So I would need to add the following lines to that Manifest.mf

Bundle-ClassPath: .
Bundle-Version: 5.1.2
Bundle-Name: xmpcore    
Bundle-ManifestVersion: 2
Bundle-SymbolicName: com.adobe.xmp.xmpcore
Export-Package: 
 com.adobe.xmp;version="5.1.2",
 com.adobe.xmp.impl;version="5.1.2",
 com.adobe.xmp.impl.xpath;version="5.1.2",

Is there a way of unpacking this maven artefact and exchanging the provided manifest via the maven dependency plugin or any different way?

Upvotes: 0

Views: 329

Answers (2)

Martin Baumgartner
Martin Baumgartner

Reputation: 3652

IIRC, Eclipse Virgo Bundlor can do that work for you. http://www.eclipse.org/virgo/documentation/bundlor-documentation-1.1.1.RELEASE/docs/user-guide/htmlsingle/user-guide.html#usage.command.line

Virgo Bundlor will add all export-Package statements + all import statements which he can find via declared import-statements in your java-files. If the jar uses dynamic classloading, you need to add a template.mf file with the additional import.

Upvotes: 0

Achim Nierbeck
Achim Nierbeck

Reputation: 5285

For runtime enhancement use the Pax URL Wrap Project. If you have this bundle in your environment add the wrap: url-schema to your bundle installation it will auto-wrap your bundle on the fly.

Upvotes: 1

Related Questions