David Ryan created LUCENE-9320:
----------------------------------

             Summary: Enable support the Java module system by adding 
module-info to projects
                 Key: LUCENE-9320
                 URL: https://issues.apache.org/jira/browse/LUCENE-9320
             Project: Lucene - Core
          Issue Type: Improvement
          Components: core/other
    Affects Versions: master (9.0)
            Reporter: David Ryan


 

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:

[http://mail-archives.apache.org/mod_mbox/lucene-dev/202004.mbox/%3c0a5e01d60ff2$563f9c80$02bed580$@thetaphi.de%3e]

The preparatory tasks are detailed in:
 # LUCENE-9317
 # LUCENE-9318
 # LUCENE-9319

Once these are complete and the move to Gradle is completed the following steps 
are required to make Lucene modules:
{quote}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)
{quote}
 

 

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:
{quote}ext.moduleName = "com.acme.mylibrary" 

jar { 

   inputs.property("moduleName", moduleName) 

   manifest { 

       attributes 'Automatic-Module-Name': moduleName 

   } 

}{{}}
{quote}
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 )
h1.  

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to