Java Reference
In-Depth Information
THE MAVEN BUNDLE PLUG-IN
Although Bindex has excellent function, it does need to be downloaded and explicitly
run. A more convenient alternative is the maven-bundle-plugin , which embeds Bin-
dex. The maven-bundle-plugin will automatically generate OBR metadata in a reposi-
tory.xml file in the local Maven repository, so you may already be creating OBR
repositories without even knowing it! The bundle plug-in has extra goals to deploy
bundles to remote OBR repositories and generate an OBR repository from all the files
in an existing Maven repository:
mvn org.apache.felix:maven-bundle-plugin:index
Listing 7.9 shows part of an OBR repository automatically generated by building the
Fancy Foods application with Maven. If you compare it to the OSG i standard reposi-
tory from listing 7.1, you'll see it's less generic but also more human-readable. We
anticipate later versions of the Maven bundle will be able to produce both OBR and
standard repository serializations.
Listing 7.9
An OBR repository.xml generated by the Maven bundle plug-in
<repository lastmodified='17874783'>
<resource
id='fancyfoods.department.chocolate/1.0.0'
symbolicname='fancyfoods.department.chocolate'
presentationname='Fancy Foods Chocolate Department'
uri='fancyfoods/fancyfoods.department.chocolate/1.0.0/
fancyfoods.department.chocolate-1.0.0.jar'
version='1.0.0'>
<size>5151</size>
<capability name='bundle'>
<p n='symbolicname' v='fancyfoods.department.chocolate'/>
<p n='presentationname' v='Fancy Foods Chocolate Department'/>
<p n='version' t='version' v='1.0.0'/>
<p n='manifestversion' v='2'/>
</capability>
<capability name='service'>
<p n='service' v='fancyfoods.offers.SpecialOffer'/>
</capability>
<capability name='package'>
<p n='package' v='fancyfoods.chocolate'/>
<p n='version' t='version' v='0.0.0'/>
<p n='uses:' v='fancyfoods.food,fancyfoods.offers'/>
</capability>
<require
name='package'
filter='(&amp;(package=fancyfoods.food)(version&gt;=1.0.0)
(!(version&gt;=2.0.0)))'
extend='false'
multiple='false'
optional='false'>
</require>
 
Search WWH ::




Custom Search