You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by motes motes <mo...@gmail.com> on 2010/10/01 13:58:45 UTC

Specify specific version for imported bundles?

I would like to use felix to generate a MANIFEST file where selected
dependencies are either added to the require or import header with a
specific version. Currently I do:

		<plugins>
			<plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<extensions>true</extensions>
				<configuration>
					<instructions>
						<Bundle-SymbolicName>com.model</Bundle-SymbolicName>
						<Bundle-Name>${project.artifactId}</Bundle-Name>
						<Bundle-Version>${project.version}</Bundle-Version>
						<Export-Package>com.model.*</Export-Package>
					</instructions>
				</configuration>
			</plugin>
		</plugins>

The generated MANIFEST file looks like this:



Manifest-Version: 1.0
Export-Package: com.model;uses:="org.eclipse.birt
 .report.model.api.activity,org.slf4j,org.eclipse.birt.report.model.ap
 i,org.eclipse.birt.core.framework,org.eclipse.birt.report.model.api.c
 ommand,com.google.inject,com.ibm.icu.util,com.google.inject.name"
Bundle-Version: 2.0.2.SNAPSHOT
Build-Jdk: 1.6.0_21
Built-By: mm
Tool: Bnd-0.0.357
Bnd-LastModified: 1285933086257
Bundle-Name: model
Bundle-ManifestVersion: 2
Created-By: Apache Maven Bundle Plugin
Import-Package: com.model,com.google.inject;versi
 on="1.2",com.google.inject.name;version="1.2",com.ibm.icu.util;versio
 n="4.0",org.eclipse.birt.core.framework,org.eclipse.birt.report.model
 .api,org.eclipse.birt.report.model.api.activity,org.eclipse.birt.repo
 rt.model.api.command,org.slf4j;version="1.3"
Bundle-SymbolicName: model


But I would like to make it explict that the bundle should only work
if version 2.6.0 of the  org.eclipse.birt.report.model
 .api is available. Is this possible?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Specify specific version for imported bundles?

Posted by "Richard S. Hall" <he...@ungoverned.org>.
  I think if you specify something in your instructions like:

<Import-Package>org.eclipse.birt.report.model.api.*; version="[2.6, 
3.0)", *</Import-Package>

It should do the trick. The first part adds the version to any matching 
packages while the "*" imports everything else the normal way.

-> richard

On 10/1/10 7:58, motes motes wrote:
> I would like to use felix to generate a MANIFEST file where selected
> dependencies are either added to the require or import header with a
> specific version. Currently I do:
>
> 		<plugins>
> 			<plugin>
> 				<groupId>org.apache.felix</groupId>
> 				<artifactId>maven-bundle-plugin</artifactId>
> 				<extensions>true</extensions>
> 				<configuration>
> 					<instructions>
> 						<Bundle-SymbolicName>com.model</Bundle-SymbolicName>
> 						<Bundle-Name>${project.artifactId}</Bundle-Name>
> 						<Bundle-Version>${project.version}</Bundle-Version>
> 						<Export-Package>com.model.*</Export-Package>
> 					</instructions>
> 				</configuration>
> 			</plugin>
> 		</plugins>
>
> The generated MANIFEST file looks like this:
>
>
>
> Manifest-Version: 1.0
> Export-Package: com.model;uses:="org.eclipse.birt
>   .report.model.api.activity,org.slf4j,org.eclipse.birt.report.model.ap
>   i,org.eclipse.birt.core.framework,org.eclipse.birt.report.model.api.c
>   ommand,com.google.inject,com.ibm.icu.util,com.google.inject.name"
> Bundle-Version: 2.0.2.SNAPSHOT
> Build-Jdk: 1.6.0_21
> Built-By: mm
> Tool: Bnd-0.0.357
> Bnd-LastModified: 1285933086257
> Bundle-Name: model
> Bundle-ManifestVersion: 2
> Created-By: Apache Maven Bundle Plugin
> Import-Package: com.model,com.google.inject;versi
>   on="1.2",com.google.inject.name;version="1.2",com.ibm.icu.util;versio
>   n="4.0",org.eclipse.birt.core.framework,org.eclipse.birt.report.model
>   .api,org.eclipse.birt.report.model.api.activity,org.eclipse.birt.repo
>   rt.model.api.command,org.slf4j;version="1.3"
> Bundle-SymbolicName: model
>
>
> But I would like to make it explict that the bundle should only work
> if version 2.6.0 of the  org.eclipse.birt.report.model
>   .api is available. Is this possible?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org