On 06/28/2012 11:45 AM, Tang Yong wrote:
Hello Rafal,
> From my experience, Bndtools + maven-bundle-plugin combination works
> quite well. You don't need to migrate away from Maven to Ant in
order >to use Bndtools.
Real Case is that:
how to import the maven-built large project into bndtools including
mave n repo's setting.
First off, I assume that the project is OSGi application built using
maven-bundle-plugin.
You should use fairly new Eclipse - 3.8 or 4.2, m2e 1.1,
maven-bundle-plugin 2.3.6+ and current Tycho m2e connector. The last is
quite counter-intuitive, but it is in fact necessary.
With this set of tools, you should be able to import the project into
eclipse workspace using "Import existing Maven projects into Workspace"
and it should build cleanly. If the build is using non-standard plugins
you might run into m2e connector problems. There are different
solutions, depending on what plugins are in use. I can offer some
assistance here, too.
Once you have the all the dependencies resolved, and all the sources
building, you can introduce Bndtools into the mix. You should create
bnd.bnd files in each module an move the configuration of BND from
maven-bundle-plugin section to that file, and add Bndtools project
nature to your project. After this is done, the modules will appear in
Bndtools "workspace" repository. Once you have the Workspace repository
populated, you can set up some run descriptors to spin up an OSGi
framework and run your appplication straight from workspace. Your
bundles will be updated in the framework on Save action on and editor,
which is allows for really smooth work flow.
Please note that you should be using m2e provided classpath container
for compile-time dependencies in Eclipse. This ensures that the project
will build the same way both in Eclipse and outside it (on CI server
etc). The runtime classpath is managed by Bndtools, and is composed of
bundles from OBR repositories. Maven repositories can be exposed as OBR
repositories in several ways, Nexus OSS + OBR plugin being probably the
most flexible, but there are simpler zero-investment solutions -
repository.xml can be generated with OSGi Bindex tool, or
maven-bundle-plugin.
regards,
Rafał
BTW: which version of bndtools are you using? Version 1.0.0?
> mine :) I can share some experiences/tips if anyone is interested.
I want to know very much! Thanks!
-Best Regrads
-Tang