Visitar URL original
Please add a module name (Automatic-Module-Name) to the jar · Issue #741 · datastax/jvector · GitHub
Skip to content

Please add a module name (Automatic-Module-Name) to the jar #741

Open

Description

@hrstoyanov

Hi, and thanks for jvector.

The jvector jar has no Java module name. There is no module-info.java in the repo, and the jar's manifest has no Automatic-Module-Name line. I checked 4.0.0-rc.9, 4.0.1 and main.

Today Java only gives it a name by looking at the file name (jvector-4.0.1.jar becomes jvector). That breaks easily if the jar is renamed or if a build tool doesn't do that. Gradle, for example, will not put such a jar on the module path.

This matters because Eclipse Store's gigamap-jvector module says requires jvector. Anyone who builds a modular app on it has to patch the jvector jar in their own build to add a name.

Simple fix: add one line to the manifest in jvector-multirelease/pom.xml:

<manifestEntries>
    <Multi-Release>true</Multi-Release>
    <Automatic-Module-Name>jvector</Automatic-Module-Name>
</manifestEntries>

The name jvector is the same name Java already picks from the file name, so nothing breaks for current users. A real module-info.java would be nicer later, but this one line solves the problem now.

I can send a pull request for this if you like.

Activity

  1. changed the title [-]Add Automatic-Module-Name (or module-info) so the jar has a stable JPMS module name[/-] [+]Please add a module name (Automatic-Module-Name) to the jar[/+] on Oct 3, 2026
  2. hrstoyanov commented on Oct 3, 2026

    @hrstoyanov
    Author

    A follow-up from the same user: a real module-info.java would be even better than the manifest line, if you are open to it.

    I looked at how the jar is built, and it is not a one-file change, so here is what I found:

    • The jar is put together from three Maven modules: jvector-base (Java 11), jvector-twenty and jvector-native. The newer classes go under META-INF/versions/20 and META-INF/versions/22.
    • jdk.incubator.vector does not exist in Java 11, so the base descriptor cannot mention it. The newer layers would need their own META-INF/versions/N/module-info.class.
    • The descriptor must export the public packages (about 17 under io.github.jbellis.jvector) and declare the uses / provides for the service loading in ManagementBackendProvider and VectorizationProvider.
    • It would be good to have a test that loads the jar from the module path.

    Suggested order: first the one-line Automatic-Module-Name: jvector (it fixes the problem for users right away and keeps the name stable), then a proper module-info.java once you have decided how to handle the Java 20 and 22 layers.

    I am happy to prototype the descriptor for jvector-base in a pull request and test it with Eclipse Store's gigamap-jvector module, which does requires jvector. Tell me which direction you prefer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions