Skip to content

Add Automatic-Module-Name to artifacts, particularly javac #1116

Closed

Description

@paulduffin

Please answer these questions before submitting your issue. Thanks!

What version of Error Prone are you using?

I'm using the javac artifact, version 9+181-r4173-1.

Does this issue reproduce with the latest release?

AFAIK it is the latest.

What did you do?

Tried to use the above from a Java 9 module-info.java file. I added the above to the module-path (using gradle so had no control over the jar name) so it would be treated as an automatic module.

What did you expect to see?

That classes would be available with a useful module name.

What did you see instead?

Java 9 reported that the classes could not be found but were in module javac.9.181.r4173.1. That is not a valid module name so it was impossible to add a "requires javac.9.181.r4173.1" to the module-info.java file to gain access to the classes.

I worked around it by adding an Automatic-Module-Name entry in the manifest (used com.google.errorprone.javac) so that would be used instead of java trying to construct one from the jar name. That would be a minimum viable solution. Alternatively, adding a complete module-info.java would work too as long as all the internal classes were exported.

It would also be helpful if the other artifacts were fixed in a similar way.

Activity

  1. cushon commented on Sep 10, 2018

    @cushon
    Collaborator

    Thanks, there's a related bug for google-java-format's javac dependency: google/google-java-format#266

  2. tbroyer commented on Sep 10, 2018

    @tbroyer
    Contributor

    On Error Prone side, javac is only needed when using Java 8; I'd rather remove it as a dependency from error_prone_core (and adapt Maven config to add an explicit (plugin) dependency on it)
    WDYT?

  3. sgammon commented on Mar 11, 2024

    @sgammon
    Contributor

    @cushon I think this one can be closed now too.

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