Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-5213

Invalid automatic module name for mongo-scala-bson and mongo-scala-driver

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.11.1
    • Affects Version/s: None
    • Component/s: Build
    • None
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      Summary

      mongo-scala-bson and mongo-scala-driver have invalid characters in the "Automatic-Module-Name" field of their META-INF/MANIFEST.MF files.

      This causes some builds to fail with the error "cannot determine module name" . This happens on a Bazel project using JDK 17.

      This is present in the latest version of these two libraries, i.e. version 4.11.0.

      How to Reproduce

      1. Download the jar file for mongo-scala-driver or mongo-scala-bson.
      2. Extract the jar file e.g.:
        unzip ./mongo-scala-bson_2.13-4.11.0.jar
      3. View MANIFEST.MF:
        cat META-INF/MANIFEST.MF
      4. Look at the content of the Automatic-Module-Name field e.g.
        Automatic-Module-Name: org.mongodb.scala.mongo-scala-bson
        and
        Automatic-Module-Name: org.mongodb.scala.mongo-scala-driver
      5. Notice the invalid "-" character in the module name.

      Additional Background

      The character "-" is not valid. For a description of the valid characters see:

      _Similar issue: https://jira.mongodb.org/browse/JAVA-5202_ 

      Suggested fix: replace "-" with a dot: ".".

            Assignee:
            slav.babanin@mongodb.com Slav Babanin
            Reporter:
            fernandoacorreia@gmail.com Fernando Correia
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: