Duplicate package names in orm/engine, causes problem with jdk9 modules


Causes problem with jdk9 modules, any module-info.java that requires classes in both engine/orm

module anymodule {
requires hibernate.search.engine;
requires hibernate.search.orm;

Will fail with
org.hibernate.search.backend.impl from both hibernate.search.orm and hibernate.search.engine
org.hibernate.search.engine.impl from both hibernate.search.orm and hibernate.search.engine
org.hibernate.search.jmx.impl from both hibernate.search.orm and hibernate.search.engine




Sanne Grinovero
September 4, 2017, 10:12 AM

Thanks for reporting this!
I'll see if we can change these still for 5.8 but can't promise it as I know that - while these are menant to be private API - some strategical projects are still using them.

Please keep in mind that while we've been testing Java9 compatibility extensively, we didn't work on making these proper modules yet: there might be more problems and if significant API changes are necessary these will have to wait for the next release.

Incidentally, this is exactly the kind of problems we've been warning the jigsaw team about. I still hope they will eventually implement proper encapsulation by allowing duplicates among classes which are not exported, as projects need to be able to evolve APIs at independent release cadence.

May I ask how you're defining the modules? Looks like we need to urgently agree at least on stable module names, however I wouldn't want to send mixed signals by suggesting that it's expected to work as a module.

pether sorling
September 4, 2017, 12:43 PM

Have started to build with multiple toolchains (jdk8 and jd9) to add support for module-info.java

My current module-info.java https://github.com/Hack23/cia/blob/master/service.data.impl/src/main/java/com.hack23.cia.service.data.impl/module-info.txt (renamed to txt, problem with javassist not working with jdk9 yet)

A simple workaround is to assemble all hibernate-search-* into one jar, example at https://github.com/Hack23/cia/blob/master/service.data.impl/jdk9hibernate-search/pom.xml .

Easy solution for stable module names is just to add "<Automatic-Module-Name>hibernate.search.orm</Automatic-Module-Name>" to manifest.


Sanne Grinovero


pether sorling



Suitable for new contributors


Feedback Requested



Fix versions

Affects versions