ongres / scram

SCRAM (RFC 5802) Java implementation
BSD 2-Clause "Simplified" License
26 stars 11 forks source link

change module name from 'client' #3

Closed alexanderkjall closed 6 months ago

alexanderkjall commented 5 years ago

Hi

I'm working on adding SCRAM support to https://github.com/pgjdbc/pgadba and that is a library that uses the module system.

The default module that this library gets published under is named 'client' and that is extremely generic.

It also gives me this warning when compiled with maven: [WARNING] Required filename-based automodules detected. Please don't publish this project to a public artifact repository!

Would you consider adding a module-info.java file?

jkuhn1 commented 7 months ago

I ran into this issue today, actually the module is named client because the JAR is lacking module metadata (no module-info and no Automatic-Module-Name entry in the MANIFEST.MF) hence the module name is whatever the name of the archive (i.e. if it is named client.jar then the module name is client) which is clearly not ideal and explains the warning.

This can be easily fixed by adding Automatic-Module-Name in the MANIFEST.MF of each modules (client, common...), Maven can do that automatically:

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifestEntries>
              <Automatic-Module-Name>${project.groupId}.${project.artifactId}</Automatic-Module-Name>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>

Then the best would be to actually modularized the library by defining proper module-info.java descriptor.

I have a way to bypass this issue within my project so it's not that urgent for me but not providing such metadata generally makes it difficult to integrate scram to a Java modular application.

Regards

jorsol commented 7 months ago

Hi, this is on the roadmap, but there's no ETA yet.