The list I gave is partially automated. I've generated it while working on an uber-jar osgi bundle (the maven-bundle-plugin can indicate packages that are split). Such a bundle is the easiest / fastest way forward as it limits the code changes. It's definitely not the best solution, but could be considered a temporary one while waiting for the required refactoring to be done. As Dan explained, going to real osgi bundles may require more work around class loading, service discovery, etc...
2015-11-16 16:10 GMT+01:00 Clebert Suconic <[email protected]>: > I think moving the packages should be an easy thing... does anyone > know an automated way to find this on any IDE or Maven thing? so far I > only know how to do manual inspection. I failed to find such thing on > google (hence the question here). > > On Mon, Nov 16, 2015 at 8:42 AM, Christian Schneider > <[email protected]> wrote: > > I agree we should try to get rid of the split packages. They are even a > > problem in plain java as you could easily create the same class > > in both without noticing at fist. > > > > A big ueber jat could be a kind of stop gap solution but I think it makes > > sense to try to avoid it if the effort is not too big. > > > > I do not like the fragment approach too much. I personally only consider > > fragments if I need to make some existing jar work and can not change > it. It > > might be a last resort if the split packages can not be resolved in any > > other way. > > > > Do you have a good way to find all the split packages? I think the first > > thing we should do is get a complete list of all split packages. Then we > can > > decide what to do. > > If there is no automated way I can make a list. > > > > The next step would be to add the maven bundle plugin with defaults and > see > > what results it produces. > > > > After that we need to see if we can make the plugin mechanism work for > OSGi. > > It seems that for example the protocols use the ServiceLoader to announce > > their impls. That might be covered by Aries spi-fly though > > I do not have any experience with it. > > > > In any case I am willing to help with the OSGi effort. > > > > Christian > > > > > > > > On 13.11.2015 15:21, Guillaume Nodet wrote: > >> > >> I was looking at supporting OSGi deployment for Artemis. > >> > >> The first big problem I hit is the existence of split packages. Split > >> packages are java packages shared across multiple jars (which become > >> bundles in OSGi). > >> Examples of those are org.apache.activemq.artemis.uri (shared between > >> artemis-jms-client and artemis-core-client) or > >> org.apache.activemq.artemis.api.config (shared between > artemis-core-client > >> and artemis-commons). > >> The reason they are problematic is that in OSGi, each bundle has its own > >> class loader, importing classes from other packages based on packages. > >> The > >> same package can not be imported from 2 different bundles. > >> > >> So the question is: would it be possible to get rid of those split > >> packages > >> ? It can be done either by moving the classes from a jar to another one, > >> keeping the same package name, or by renaming one of the split package > so > >> that there's no duplicate package names across jars. > >> > >> Thoughts ? > >> Guillaume Nodet > >> > > > > > > -- > > Christian Schneider > > http://www.liquid-reality.de > > > > Open Source Architect > > http://www.talend.com > > > > > > -- > Clebert Suconic >
