Closed Azquelt closed 1 day ago
It looks like we are adding the osgi.annotation jar as an extra dependency when building the Javadoc: https://github.com/eclipse/microprofile/blob/730e56d96757c0aa2c9eb14f21f09dba9c7baf6d/pom.xml#L142-L150
I'm not sure why this isn't sufficient - it may be because osgi.annotation isn't an explicit module and doesn't have an Automatic-Module-Name
header?
For the moment, we can set the javadoc plugin to assume the source code is Java 8:
<configuration>
<source>8</source>
</configuration>
This then builds non-modular Javadoc including all the packages.
I think this only works because all of the API source files aren't using classes or features from Java 11, even where the spec is targeting Java 11, so in the longer term I think we'll need a different solution.
Javadoc seems to be unable to generate an aggregated Javadoc for a mix of java modules and non-modules, so I think we either have to make all our specs modular (which could be done with multi-release jars), or manually modify the source of each modular API jar to remove the module-info before it's used to generate the Javadoc.
I did also run into issues where additional dependencies were put on the classpath and not the module path and so were not detected as modules which could be used to satisfy module dependencies. I imagine that at some point we'll want to build aggregated modular Javadoc so this is a problem we'll have to tackle eventually.
I also took a look to see how other projects generate their Javadoc which wasn't very inspiring, Jakarta use a whole bunch of ant to extract each spec's source, make modifications and run javadoc
. JUnit 5 uses gradle to aggregate and then fixup the javadoc.
When I try updating the
pom.xml
with the RC versions of the MP 7.0 features (to test eclipse/microprofile-telemetry#209) the build output has this error and no javadoc is built:I note that MicroProfile OpenAPI 4.0 has added a module-info.java but I'm not sure why that project builds ok but we get issues building the aggregated Javadoc.