Description
When trying to build any library, framework (e.g. Spring Data for Apache Geode (SDG)) or application with Apache Geode on Java 17, Javadoc errors occur.
For example:
22:36:52 [ERROR] /opt/jenkins/data/workspace/spring-data-geode_3.0.x/spring-data-geode/src/main/java/org/springframework/data/gemfire/function/PojoFunctionWrapper.java:53: error: cannot access Identifiable 22:36:52 [ERROR] public class PojoFunctionWrapper implements Function { 22:36:52 [ERROR] ^ 22:36:52 [ERROR] class file for org.apache.geode.lang.Identifiable not found
As it turns out, in Java 17, the Javadoc tool now uses Java modules. Javadoc is started with:
javadoc … --add-modules ALL-MODULE-PATH --module-path --patch-module …
geode-core-1.14.0.jar ships org.apache.geode.lang.AttachAPINotFoundException and geode-common-1.14.0.jar ships org.apache.geode.lang.Identifiable. Due to this split-package arrangement, Javadoc isn’t discovering Identifiable because it has found the package org.apache.geode.lang in geode-core-1.14.0.jar.
The best course of action is to make sure all org.apache.geode.lang sub-packages and class are in 1 JAR (e.g. geode-common) or the other (i.e. geode-core).