Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-9320

Enable support the Java module system by adding module-info to projects

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: main (9.0)
    • Fix Version/s: None
    • Component/s: core/other
    • Labels:
    • Lucene Fields:
      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:

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

      The preparatory tasks are detailed in:

      1. LUCENE-9317
      2. LUCENE-9318
      3. LUCENE-9319

      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

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              oobles David Ryan

              Dates

              • Created:
                Updated:

                Issue deployment