SingingBush opened a new pull request, #99:
URL: https://github.com/apache/johnzon/pull/99

   now that Java 11 is the minimum adding proper support for JPMS using a 
_module-info.java_ instead of specifying _Automatic-Module-Name_ is preferable. 
Unfortunately this will involve a fair amount of refactoring so this PR is a 
mix of both approaches.
   
   As mentioned in 
[JOHNZON-305](https://issues.apache.org/jira/browse/JOHNZON-305), getting the 
_Automatic-Module-Name_ configured using maven-jar-plugin was not working due 
to the bundle plugin. I ended up setting the auto module name using the 
maven-bundle-plugin itself in most cases.
   
   The core module is done properly with a _module-info.java_ but adding that 
to all the maven modules won't work without a fairly large PR. I'd like to know 
if there's interest in merging this before making further changes.
   
   In the projects that I've done previously with JPMS I've generally gone with 
the approach of putting unit tests into a different package name to prevent the 
split packages problem. For example, all the tests under 
*org.apache.johnzon.core* I'd change the package to something like 
*ut.johnzon.core*. That way a _module-info.java_ can be defined in the main 
source and the test source. I noticed there are some tests in Johnzon that rely 
on test classes being in the same package as source files to get access to 
package private code. That would need some re-work.
   
   Getting _johnzon.core_ working with JPMS was fairly straight forward. I have 
a module info locally for _johnzon.mapper_ that essentially works when 
compiling the main source but could not include it in the PR due to 
_JsonGeneratorCloseTest_ using test code in the _org.apache.johnzon.core_ 
package. That would be along the lines of:
   
   ```
   module johnzon.mapper {
       requires java.desktop; // for java.beans
   
       requires jakarta.cdi;
       requires jakarta.json;
       requires jakarta.persistence;
       requires jakarta.transaction;
   
       requires johnzon.core;
   
       opens org.apache.johnzon.mapper.internal to johnzon.jaxrs;
   
       exports org.apache.johnzon.mapper;
       exports org.apache.johnzon.mapper.access;
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@johnzon.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to