Hakky54/sslcontext-kickstart

Add support for Java Platform Module System

Closed this issue · 5 comments

End users should still be able to use this library with java 8 while it is also compatible with java modules (Java 11+)
Every maven module should contain module-info.java
Internal libraries should be encapsulated and if required only exposed to sub maven modules.

To be expected:

  • New major release
  • Breaking changes (package name changes in submodules as it is conflicting with the core module)
  • Internal api with public access modifiers will be moved to a sub package internal and will be locked with modules

I was playing with a fork (https://github.com/bjorndarri/sslcontext-kickstart, branch modules), changed version.java, to 11, added module-info.java files as well as those module specific packages (had to make a couple of utility methods public) and managed to compile without errors. Building failed rather predictably when running unit-tests, those will require some module-fiddling, adding modules via compiler arguments and such. It looked like it would take me (a Gradle guy) a bit too long to figure that out.

This isn't meant as a basis for a pull-request or anything, I just wanted to provide an example of how this could be done.

And yes, I do realise that I've basically just done the easy part 😄.

Thank you Björn, your code changes are a good way to start for me. I initially thought about the module name as artifact and groupid as combined, but that is pretty long. I liked that you used the package name as module name like nl.altindag.ssl.apache4 The package name renaming looks also good, I would also have done it like that for the submodules.

I think there are some issues with the integration tests, it is using sun libraries like the httpserver which I still need to replace with a third party server. I will use your changes as base for the initial code changes

This isn't meant as a basis for a pull-request or anything, I just wanted to provide an example of how this could be done.

Feel free to create a PR, if you want 😄

I was a bit eager, I also did some code changes. Maybe you can have a look at it: #333

@bjorndarri I released the change today to version 8.0.0
Have a nice day!