This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Other Application Frameworks and the fly likes Maven bundle plugin and version ranges Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Maven bundle plugin and version ranges" Watch "Maven bundle plugin and version ranges" New topic
Author

Maven bundle plugin and version ranges

Augusto Sellhorn
Ranch Hand

Joined: May 24, 2007
Posts: 57
This would have been a great question for the authors of OSGi in Action, but oh well, just thought about it now after a conversation with a friend.

When the maven bundle plugin does its magic for creating Import-Package for you, when it has a dependency that has a version in it it automagically does this;



Now it resolves this I believe because the dependency section of the pom has a bundle that exports that package, and that bundle's version is 1.8. That's great, in the container this directive resolves to : use version 1.8+ to resolve this package. Very nice.

Now, what about version ranges? More specifically, let's say I want to restrict this to say ONLY support version 1.8 of that package? I can do this manually like this;



Now, is there a way to tell the plugin to do this and maybe other variations, without me needing to type in all possible packages for my project?
Richard S. Hall
author
Ranch Hand

Joined: Feb 14, 2011
Posts: 47
Augusto Sellhorn wrote:
Now, what about version ranges? More specifically, let's say I want to restrict this to say ONLY support version 1.8 of that package? I can do this manually like this;



Now, is there a way to tell the plugin to do this and maybe other variations, without me needing to type in all possible packages for my project?


maven-bundle-plugin uses bnd and bnd allows you to specify various version range policies. Check the bnd documentation on Peter Kriens' web page.
 
Don't get me started about those stupid light bulbs.
 
subject: Maven bundle plugin and version ranges