-
Notifications
You must be signed in to change notification settings - Fork 2
Java module support #15
Comments
True, the module-info.java file is missing. |
Yeah, json-schema-validator is not module-compatible neither... So there's 3 ways forward
What do you think ? |
Thank you for your helpful comments. |
Well, the library is completly function WITHOUT module but "almost functional" under java with module... and a slight modification may do the trick. The problem is that, when a non module JAR is used, java tries to generate a module name from the jar name. However, module names can't have a dash ("-") in their name... so it doesn't work with "java-idmef-library". A simple workaround is to define an "Automatic-Module-Name" property in the MANIFEST.MF:
for this, you need to add to your build.gradle the following lines:
After that, when you use the library from a module in java, you will only need to declare it in your "module-info.java" like:
and it seem to work OK on your example:
Maybe a simple update for 1.0.3 ;-) |
As a reference, in case there is no update to the library, it's possible to use this "non modular" library from a modular java (ex. with JavaFX) using https://github.com/gradlex-org/extra-java-module-info to automatically add the 'Automatic-Module-Name': 'org.idmefv2' in the manifest of the calling application. In the application, edit your build.gradle and add at the beginning of the file (before the plugins):
then, in the build.gradle add the following lines:
if you're using the JAR file (with COMPILED CLASSES, see #16) locally, so if your files contains :
or
if you're using the JAR file (with COMPILED CLASSES, see #16) from a maven repository :
|
Hello
The library can't be used currently in a java-module environment (java 9+).
It's missing the module-info.java file.
The text was updated successfully, but these errors were encountered: