You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Al...@miranda.com on 2012/10/25 00:44:54 UTC

maven-bundle-plugin BND instruction


Hey guys
I'm using MBP to wrap a jar. Here is my configuration

<build>
		<plugins>
			<plugin>
				<!-- | the following instructions are optimized for
wrapping third-party
					libraries as OSGi bundles -->
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<configuration>
					<instructions>
						<Bundle-SymbolicName>$
{bundle.symbolicName}</Bundle-SymbolicName>
						<Bundle-Version>${wrapped.version}</
Bundle-Version>
						<!-- | export wrapped contents: don't
use Export-Package:* as this
							bundles everything on the
classpath -->
						<_exportcontents>*</_exportcontents>
						<Embed-Dependency>
*;scope=compile;type=!pom;inline=true</Embed-Dependency>
						<Import-Package>!com.sun.*, !sun.*</
Import-Package>
						<!-- | each module can add to these
defaults in their osgi.bnd file -->
						<_include>~osgi.bnd</_include> <!-- ~
means append to the current values, - means override -->
					</instructions>
				</configuration>
			</plugin>
		</plugins>

	</build>

And here is my osgi.bnd file
Import-Package: !cryptix.provider.*, !xjava.security, *


The problem is in the _include part: the tilde is not working as I
understand as described by BND. If i replace the ~ with - it works fine but
only the patterns from the file are used (i.e. the Import-Package
exclusions from the pom are lost).

Here is what BND says

By default, a property defined in an include file override earlier
definitions, this implies that any property in the bnd file is overridden
if defined in an include file. The include files are read in the order they
are listed where later files override earlier files. If there are multiple
definitions for the same property, then the last definitions wins. If the
path of an included file starts with a ~, then it will not override earlier
set properties.

Is this a bug in MBP or am i misunderstanding something? ultimately what
i'm trying to accomplish is to have a set of common excludes but i want to
add more at the per-project level (each project inherits from this POM) via
a BND file. Is this possible?

Thanks,

Alejandro
DISCLAIMER:

Privileged and/or Confidential information may be contained in this
message. If you are not the addressee of this message, you may not
copy, use or deliver this message to anyone. In such event, you
should destroy the message and kindly notify the sender by reply
e-mail. It is understood that opinions or conclusions that do not
relate to the official business of the company are neither given
nor endorsed by the company.

Thank You.