bnd-maven-plugin in combination with Maven Tycho

363 views
Skip to first unread message

Dirk Fauth

unread,
Apr 21, 2015, 4:38:09 AM4/21/15
to bndtool...@googlegroups.com
Hi,

I have learned about the advantages of bndtools for building OSGi bundles. And it looks really nice.

Now I am working a lot in Eclipse related projects, therefore I create Eclipse features and products. For that Maven Tycho is really nice, since you don't need to specify the dependencies at several places.

As far as I understand, with bndtools I don't even have to manage the dependencies via MANIFEST.MF anymore myself. But bndtools don't know about Eclipse features, products and p2 repositories.

What would be interesting from an Eclipse developers point of view would be to combine bndtools for creating bundles with Maven Tycho for building Eclipse products etc.

Does anybody know if this is possible with the bnd-maven-plugin? Is there another way to combine those two worlds?

Any hints appreciated.

Greez,
Dirk

Neil Bartlett

unread,
Apr 21, 2015, 5:18:09 AM4/21/15
to bndtool...@googlegroups.com
Unfortunately I don’t know much about Tycho, but what would it actually add to this scenario? We already build Eclipse products using Bndtools with no need for PDE or Tycho… specifically, Bndtools is built with Bndtools. If the output artefact is any kind of JAR then we can build it.

Having said that, Eclipse Plugin development is a little hampered because we lack the extension/extension-point editor from PDE. So we are forced to write plugin.xml using an ordinary XML editor, which means lots of referring to documentation.

I should also point out that we are at the very early stages of integrating bnd-maven-plugin with Bndtools. So you may find it’s easier to just use it with m2eclipse at this time.

Regards,
Neil



--
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Davy Meers

unread,
Apr 21, 2015, 7:25:24 AM4/21/15
to bndtool...@googlegroups.com
I haven't used Tycho in a while, so all i can offer are some idea's.

I assume the bundles created with Bndtools are available in a Maven repository.
Would it be possible to specify the dependencies in the POM file of the feature project, and configure the Tycho target-platform-configuration plug-in to consider POM dependencies?
Another idea is to aggregate the bundles in a p2 repository (using f.e. a Tycho eclipse-repository[1] project), reference that p2 repository in the target file, and develop the features and products with Tycho as usual.

Regards, 
Davy

Neil Bartlett

unread,
Apr 21, 2015, 7:36:34 AM4/21/15
to bndtool...@googlegroups.com
So I think before looking for ways to use Tycho, I think you need to go back to your actual requirements and work how they can be solved in the simplest way.

If you have to take a bunch of Eclipse Plugins from a p2 repository and use them as build dependencies, then you will have a problem in standard Maven, because Maven expects dependencies to be in an M2-format repository. The bnd-maven-plugin doesn’t interfere with that at all. One of the things that Tycho offers is to replace the dependency mechanism in Maven with one based on p2 repositories… but it then requires you to specify your dependencies in a manually-written MANIFEST.MF, which doesn’t fit well with Bndtools. Frankly I believe that if you want to use Maven then you should provide dependencies in the normal Maven way.

This isn’t my itch to scratch, but if you want to investigate ways to integrate Tycho with Bndtools and/or bnd-maven-plugin then I can certainly provide support via this mailing list.

Regards,
Neil

Dirk Fauth

unread,
Apr 21, 2015, 9:01:56 AM4/21/15
to bndtool...@googlegroups.com
> We already build Eclipse products using Bndtools with no need for PDE or Tycho… specifically, Bndtools is built with Bndtools.

But Bndtools is a set of plug-ins that can be added to an Eclipse IDE, not an Eclipse product. Or am I missing something? Or maybe my explanation is not good enough. What I want to achieve is to build an Eclipse RCP based application using bndtools. And as far as I understand, Bndtools doesn't support that. The last steps (features, products, p2 repositories) are missing. Well, missing related to Eclipse, not OSGi of course. :-)

> Frankly I believe that if you want to use Maven then you should provide dependencies in the normal Maven way.

Then I don't see a reason for combining both worlds. IMHO the reason why Tycho is widely used with Eclipse is, because you only need to configure your dependencies as you did for a long time in the MANIFEST.MF. The pom files are quite simple. But of course you need to configure the dependencies manually using PDE.

That said, I think if there would be some possibility to either access the generated MANIFEST.MF via Tycho, or as DavyMeers suggested, create some temporary p2 repository that can be used to build against, it could work. Maybe a similar approach to what Peter Kirschner explained for BND and PDE might be sufficient: https://www.eclipsecon.org/europe2014/sites/default/files/slides/An%20epic%20split%20between%20OSGi%20tooling%20Eclipse%20PDE%20and%20Bndtools%20-%20EclipseCon%20Europe%202014.pdf

But of course I don't want to introduce an additional Ant task to create a p2 repository for the bundles created via Bndtools. The goal would be to use Bndtools for the bundles, and then use Tycho for building features, products, the final p2 repository.

Thanks for the answers so far. I will make up my mind and let you know if I make some progress on this. And surely when I need help ;-)
Reply all
Reply to author
Forward
0 new messages