Ways to split bindings into several bundles

I’m thinking about to rewrite the ebus binding for openHAB2.
My idea is to create a core ebus communication library that is not dependent on openHAB2.
So every one can use this library without openhab dependencies.

Normally I would create more bundles to split the project. But I’m not sure what is the
acceptable way in the openhab project. This are my ideas so far. Any recommendation?

Idea 1
Create a separate project outside of openhab on github for the core. Add the compiled jar
to the new binding.

Idea 2
Create an openhab I/O or transport bundle for the core. Use this bundle in the new binding.

Idea 3
Create a separate project outside of openhab on github for the core. Import/copy the project sources
to the new binding. So all sources available in the new binding.

I would probably suggest #1. #2 is a variation that could be used if there’s a need for different transports and you want to provide the option to use serial/ethernet/etc (I don’t have a clue about ebus, so treat this as an example and excuse my probable stupidity :wink: ).

If your goal here is to provide a library outside of OH, as it appears to be, then I’d probably avoid #3 since then you have more of a maintenance issue. If you want to provide source for debugging, then in your separate library you can easily produce a source JAR that allows you to have source for debugging within OH…

I would go with Idea 1, but also make sure that your freshly created library is available on maven central. bintray or sonatype are two helpful places to get that step done.

Okay thank you for your answers. I also think solution #1 is the best way. I will start. Good hint with maven central.