json-schema-validator icon indicating copy to clipboard operation
json-schema-validator copied to clipboard

Update to Java 11

Open chrswk opened this issue 3 years ago • 8 comments

Not sure what the stance of this project is in regards to newer Java versions. I've been using this library for a couple of years now and I would love to see it with a proper module info file. Feel free to change the module name if it's not appropriate and let me know, if there are any changes I should make.

-Chris

chrswk avatar May 14 '21 13:05 chrswk

@chrswk I would love to upgrade to Java 11; however, there are still a lot of users stuck on Java 8 and needs this library. It took us a lot of discussions when we upgrade from Java 6 to Java 8 and we cannot simply upgrade to Java 11 and leave some of our users behind. I am open to ideas to upgrade to Java 11 but want to have another branch/release for Java 8 users if possible.

stevehu avatar May 14 '21 15:05 stevehu

@stevehu I completely understand. I'll try to figure something out using multi release/module info.

chrswk avatar May 24 '21 12:05 chrswk

Can we use Java 16 for the tests, but keep Java 8 for main? This will allow me to use text blocks https://openjdk.java.net/jeps/355

SiemelNaran avatar Nov 05 '21 20:11 SiemelNaran

@SiemelNaran The current source level is java 8 because a lot of users are still using it and we cannot leave them out. If we use java 16 for test cases, some developers might complain about it. Let's stay on Java 8 for now and think about upgrading when most users are upgraded.

stevehu avatar Nov 05 '21 20:11 stevehu

I hit these issues while investigating a bug that required me to rebuild the source code. I only have JDK 11 and 17 on my machine - those being the two JDK LTS releases that are current. (8 having gone EOL some time ago)

It would be great if you could upgrade maven-bundle-plugin to 5.1.2 and maven-compiler-plugin to 3.8.1

Even if you leave the default target as 1.8, having those upgraded will allow people to change the target to 11 easily.

TJC avatar Apr 08 '22 13:04 TJC

@TJC I think it is a good idea to upgrade the plugins as long as the upgraded version still working with JDK8. Could you please submit a PR? I will test it with my local VM with Java8 installed. Thanks.

stevehu avatar Apr 11 '22 13:04 stevehu

For solving the module info problem on pre- and post-jigsaw Java versions, how about at least adding an Automatic-Module-Name to the MANIFEST.MF like in this PR: https://github.com/protocolbuffers/protobuf/pull/6568

It's not perfect, but it's better than not providing any module name which means this sort of warning happens to clients on building with maven:

[WARNING] ********************************************************************************************************************
[WARNING] * Required filename-based automodules detected. Please don't publish this project to a public artifact repository! *
* Required filename-based automodules detected. Please don't publish this project to a public artifact repository! *
********************************************************************************************************************

julesjacobsen avatar Jun 01 '22 12:06 julesjacobsen

If this project upgrades to Java 11 I recommend Apache Commons lang3 get removed since all of its uses appears to be to use StringUtils.isNotBlank. Java 11 has String.isBlank builtin.

agentgt avatar Jul 31 '22 19:07 agentgt