maven - Can't run OSGi wrapper bundle in Eclipse; .jar is building okay, but how do I also copy files into target/classes? -


first of all, know number of questions have been asked before wrapping existing maven dependencies osgi bundles, have problem don't see directly addressed in of answers...

the bundle jar problematic project being built successfully, dependencies , appropriate metadata generated , copied it. outstanding issue target/classes directory remains empty aside meta-inf/manifest.mf, means launching bundle in equinox part of osgi run configuration within eclipse doesn't work.

i know .jar in target built properly, after copying contents target/classes manually can launch , works expected.

    <plugin>       <groupid>org.apache.felix</groupid>       <artifactid>maven-bundle-plugin</artifactid>       <version>2.4.0-snapshot</version>       <extensions>true</extensions>       <configuration>         <instructions>           <export-package></export-package>           <private-package>*</private-package>           <require-capability>osgi.extender; filter:="osgi.extender=osgi.serviceloader.registrar)"</require-capability>           <provide-capability>osgi.serviceloader; osgi.serviceloader=javax.script.scriptenginefactory</provide-capability>           <import-package></import-package>           <embed-transitive>true</embed-transitive>           <embed-dependency>*;scope=runtime|compile;inline=true</embed-dependency>           <service-component>*</service-component>           <_dsannotations>*</_dsannotations>         </instructions>         <archive>           <addmavendescriptor>true</addmavendescriptor>         </archive>       </configuration>     </plugin> 

the important lines being, suppose:

          <embed-transitive>true</embed-transitive>           <embed-dependency>*;scope=runtime|compile;inline=true</embed-dependency> 

does know of method of wrapping osgi bundles in maven projects such copied target/classes bundle jar? or of way ask eclipse run configuration .jar rather looking in directory?

the thought occurred me might solvable hacky post-build maven step extract jar target/classes, though far ideal. perhaps use profiles limit eclipse use or something, though i've not had deal before i'm unsure...

thanks in advance help!

seems answer simple. need add <unpackbundle>true</unpackbundle> under configuration of maven-bundle-plugin. in fact seems it's not sensible perform step in specific 'eclipse' profile. see http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html#apachefelixmavenbundleplugin%28bnd%29-unpackingbundlecontentsto%27target/classes%27 explanation of why case.


Comments

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -