OSGI compatible MANIFEST.MF

36 views
Skip to first unread message

Leen Toelen

unread,
Feb 14, 2011, 7:24:48 AM2/14/11
to mobicent...@googlegroups.com
Hi all,

would anyone oppose patches in pom.xml so that OSGI metadata is created for all mobicents jars? This would help people who run in an OSGI container tremendously. This is a build change only, and only the MANIFEST.MF is changed, at runtime nothing from OSGI is used. I know that the next JBoss does this ad-hoc, but creating an valid manifest is never a bad thing.

When using maven, maven-bundle-plugin ( http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html ) is the most widely tools used to make the manifest OSGI-compatible.

Regards,
Leen

Eduardo Martins

unread,
Feb 14, 2011, 9:02:41 AM2/14/11
to mobicent...@googlegroups.com
Strictly referring to the current MANIFEST.MF present in Mobicents
jars, what changes are needed to make it OSGI compatible?

-- Eduardo
..............................................
http://emmartins.blogspot.com
http://redhat.com/solutions/telco

Leen Toelen

unread,
Feb 14, 2011, 10:05:35 AM2/14/11
to mobicent...@googlegroups.com
Hi,

looking at http://en.wikipedia.org/wiki/OSGi and the OSGi
documentation these are the required headers

Bundle-ManifestVersion
Bundle-SymbolicName
Bundle-Version

but the following headers are almost always needed when using them
from other bundles

Export-Package
Import-Package

maven-bundle-plugin uses BND ( http://www.aqute.biz/Code/Bnd ) in the
background to analyze all used imports and generates a correct and
up-to-date manifest.mf.

Regards,
Leen

Eduardo Martins

unread,
Feb 14, 2011, 10:49:13 AM2/14/11
to mobicent...@googlegroups.com
Currently we use the maven jar plugin configuration to setup the
MANIFEST.MF file:

...
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<Implementation-Title>
${manifest.implementation.title}
</Implementation-Title>
<Implementation-Version>
${manifest.implementation.version}
</Implementation-Version>
<Implementation-Vendor-Id>
${manifest.implementation.vendor}
</Implementation-Vendor-Id>
<Implementation-URL>
${manifest.url}
</Implementation-URL>
<SVN-Revision>${buildNumber}</SVN-Revision>
</manifestEntries>
</archive>
</configuration>
</plugin>
...

This is done by our parent pom, which can be seen at
http://code.google.com/p/mobicents/source/browse/branches/parent/2.x.y/pom.xml

Can you provide me the alternative pom code to build this OSGI
compliant MANIFEST.MF? I would update the parent pom with it.

-- Eduardo
..............................................
http://emmartins.blogspot.com
http://redhat.com/solutions/telco

Leen Toelen

unread,
Feb 15, 2011, 2:37:19 AM2/15/11
to mobicent...@googlegroups.com
Hi Eduardo,

I don't have a build envirnment available right now so I cannot test
it, but this should do the trick I guess

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<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>
<configuration>
<supportedProjectTypes>
<supportedProjectType>jar</supportedProjectType>
<supportedProjectType>bundle</supportedProjectType>
<supportedProjectType>war</supportedProjectType>
</supportedProjectTypes>
<instructions>


<Implementation-Title>${manifest.implementation.title}</Implementation-Title>
<Implementation-Version>${manifest.implementation.version}</Implementation-Version>
<Implementation-Vendor-Id>${manifest.implementation.vendor}</Implementation-Vendor-Id>
<Implementation-URL>${manifest.url}</Implementation-URL>
<SVN-Revision>${buildNumber}</SVN-Revision>

<!-- Bundle-SymbolicName and other headers can be changed here as well -->
</instructions>
</configuration>
</plugin>


Regards,
Leen

Eduardo Martins

unread,
Feb 17, 2011, 8:07:53 AM2/17/11
to mobicent...@googlegroups.com, Leen Toelen
Tks, I created an issue to validate that. Keep an eye on it, or
perhaps add yourself in cc to receive updates.

http://code.google.com/p/mobicents/issues/detail?id=2364

-- Eduardo
..............................................
http://emmartins.blogspot.com
http://redhat.com/solutions/telco

Reply all
Reply to author
Forward
0 new messages