Wrapping plain jar to OSGi bundle using bndwrap

546 views
Skip to first unread message

Rajbir Saini

unread,
Sep 15, 2012, 1:57:00 PM9/15/12
to bndtool...@googlegroups.com
Hi,

I am trying to wrap a plain jar file to a OSGi bundle using bndwrap task but it is not creating the OSGi headers into the target jar. It looks it simply copies the jar file to the target folder without any modification. I have also tried the the command line and it also just copy the file with a warning. Can you please have a look and see what is wrong with the ant target and command line?

This is the ant target definition.

 <target name="osgi-wrap" depends="prepare" description="Wrap non-OSGi jars">
        <taskdef resource="aQute/bnd/ant/taskdef.properties" classpath="${bnd.lib}"/>
        <bndwrap
            jars="framework/start/build/lib/ofbiz.jar"
            failok="true"
            trace="on"
            output="${dist.dir}/bundles"
            exceptions="true" >
        </bndwrap>
        <move overwrite="true" todir="${dist.dir}/bundles" >
            <fileset dir="${dist.dir}/bundles" includes="*.bar" />
            <mapper type="glob" from="*.bar" to="*.jar" />
        </move>
    </target>

Build Output:

osgi-wrap:
  [bndwrap] # check for modified build=1331708346000 file=0, diff=1331708346000
  [bndwrap] # Saving jar to /home/xxx/ofbiz/dist/bundles/ofbiz.jar
  [bndwrap]                      null-null  85893

BUILD SUCCESSFUL


Command line

java -jar lib/biz.aQute.bnd-2.0.0.jar wrap  framework/start/build/lib/ofbiz.jar

Output:

-----------------
Warnings
000: Using defaults for wrap, which means no export versions

Thanks,

Raj


shadogray

unread,
Oct 15, 2012, 5:39:11 PM10/15/12
to bndtool...@googlegroups.com

maybe the same problem as this: https://github.com/bndtools/bnd/issues/269
either you fix yourself or vote for the fix to be accepted

Thomas
Reply all
Reply to author
Forward
0 new messages