Evaluating maven based DXP modules

I had this plugin for Liferay 6.2 that quite limited in terms of complexity.
A perfect candidate to try to port it to a proper DXP OSGi module, I would say.

This is probably true as long as you're willing to sacrifice your current build infrastructure and processes and adopt the new Gradle way of setting up your project.

But we have invested a lot in our automated build environment and in knowledge by our people.
This means: develop proper maven based artifacts, deployable to Nexus, versionable with the Maven release plugin, stackable with parent / super POM hierarchies, etc....

So, we'd rather stick with that.

After a day of experimenting, reading up on the current state of affairs with regards to IDEs, CLI tools (blade, Gradle buildship, BNDtools, what have you) my preliminary conclusion is not so positive:

Some guy from Portugal wrote a few blog posts on transitive dependencies in OSGi in general, and scanning over them revealed that there is no proper transitive dependency resolution/inclusion mechanism with OSGi. So solutions have to be found outside OSGi and in the domain of build tooling.

But apparently, within the Liferay ecosystem of build tooling this has not been addressed either.

David Nebinger did a clear Liferay-oriented sum-up of OSGi ways to include dependencies but this does not go as far as to include the automatic build process with having dependencies only in a single place (i.e. you'd still have to list _all_ transitive dependencies from your POM or build.gradle in bnd.bnd in order to have them shipped with your module.

So... I sincerely hope that I have to nuance my words later on, either because I have overlooked something, or that there is a maven plugin in the works that will magically solve everything...

To be continued...

Blogs
Hi Geert,

You are correct in the the CLI tools like Blade and BND are currently geared more towards Gradle but I believe you can definitely have a well functioning environment running exclusively using only Maven.

We have started many 7.0 projects that are exclusively using Maven. The only issue they have found right now are with theme building and archetypes which we hope to address by the end of this quarter.

In terms of dependency management, it is not an issue with Maven but more of an issue with OSGi as you now have to deal with dependencies twice (once in your pom.xml and once in your bnd file). We have to deal with this also when using Gradle.

While it may seem like a chore to do double work, it really does help ensure that each module is independent from each other as much as possible and we feel that is worth the trade off along with all the other benefits of OSGi.

The bndtools handles this most seamlessly but is gradle based.

Please feel free to send me more feedback on your Maven development.

Thanks,
Dave