This week's book giveaway is in the General Computing forum.
We're giving away four copies of Emmy in the Key of Code and have Aimee Lucido on-line!
See this thread for details.
Win a copy of Emmy in the Key of Code this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Maven bundle plugin and version ranges

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
author
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
Of course, I found a very beautiful couch. Definitely. And this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!