Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Duplicate
-
9.0
-
None
-
New
Description
To allow Lucene to be modularised with Java module system there are a number of tasks to be completed prior to this being possible. These are detailed by Uwe on the mailing list here:
The preparatory tasks are detailed in:
Once these are complete and the move to Gradle is completed the following steps are required to make Lucene modules:
As we are on Java 11 already, add module-info.java everywhere
Fix gradle build to create and test modules (Latest Gradle needed)
++++Migrate all META-INF/services/* to module-info.java (before doing this, figure out of the META-INF files must stays for non-module usage, or if Java is clever enough to also look into module descriptor to find services). We may need all services at both locations (for module or classpath usage; we need a build helper to check that it’s in-line)
As an interim step it is also possible to add Automatic-module-name to libraries to stop Java from using an invalid name. This can be done in Gradle by adding:
ext.moduleName = "com.acme.mylibrary"
jar {
inputs.property("moduleName", moduleName)
manifest
Unknown macro: { attributes 'Automatic-Module-Name'}
}{{}}
This has the advantage that if you're not ready to add module-info.java to projects you can reserve the module name. Users of the library using modules will not be required to update for the Java automatic name based on the jar file name (e.g. lucene.core ) to the new name (e.g. org.apache.lucene.core )
Attachments
Issue Links
- relates to
-
LUCENE-10255 Fully embrace the java module system
- Patch Available