vt-middleware / ldaptive

A simple, extensible Java API for interacting with LDAP servers
56 stars 26 forks source link

Basic Java module support #212

Closed jkuhn1 closed 2 years ago

jkuhn1 commented 2 years ago

Hi,

It appears that MANIFEST.MF doesn't provide the Automatic-Module-Name attribute which makes the library difficult to use with the Java module system.

Without it, the name of the module in a requires directive would be the name of the JAR file which is subject to change leading to compile and runtime issues.

Would it be possible to include this in the build using something like this:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-jar-plugin</artifactId>
  <configuration>
    <archive>
      <manifestEntries>
        <Automatic-Module-Name>org.ldaptive</Automatic-Module-Name>
      </manifestEntries>
    </archive>
  </configuration>
</plugin>

In the long run it would be better to convert the library to a Java module by defining a proper module-info.java but the attribute should be enough for now.

Regards