I have a large-ish project that builds JPMS "Automatic-Module-Name"
artifacts. At this point, I have the system to create per module javadocs
that use Java 9+ style (.../target/apidocs/{module.name}/module-summary.html
is the starting page).

Now I am trying to aggregate the various artifacts into a single, project
javadoc jar which contains all the modules. I tried a somewhat naive
approach, adding a new maven module to the project using "pom" as
packaging, declaring dependencies on all my maven modules and add a javadoc
configuration:




















*<plugin>    <artifactId>maven-javadoc-plugin</artifactId>    <executions>
      <execution>            <id>javadoc-jar</id>            <goals>
        <goal>aggregate-jar</goal>            </goals>
<phase>package</phase>            <configuration>
<includeDependencySources>true</includeDependencySources>
<detectOfflineLinks>false</detectOfflineLinks>
<dependencySourceIncludes>
<dependencySourceInclude>org.jdbi:*</dependencySourceInclude>
  </dependencySourceIncludes>            </configuration>
</execution>    </executions></plugin>*

this does not work. The plugin never considers the build being JPMS
modularized, creates an options file with a class path only and then fails
during building the aggregation jar.

I changed the packaging of the module in which the aggregate jar is built
from pom to jar. This now creates a javadoc/apidocs/options file that uses
a module path and also patches all the modules
that are included. However, this now fails with








*MavenReportException: Error while generating Javadoc:[ERROR] Exit code:
1[ERROR] error: too many patched modules
(org.jdbi.v3.core,org.jdbi.v3.caffeine,org.jdbi.v3.cache.noop,org.jdbi.v3.testing),
use --module-source-path[ERROR] 1 error[ERROR] Command line was:
/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/bin/javadoc
-J-Xmx1024m @options @packages[ERROR][ERROR] Refer to the generated Javadoc
files in '/Users/henning/code/jdbi/javadoc/target/apidocs' dir.*

At this point, I am stuck. It is not clear to me how to create an aggregate
jar correctly. I looked at the MJAVADOC-639 integration test which seems to
be similar to my first approach.

Any pointers appreciated.

-h

Reply via email to