简体   繁体   中英

Maven Compile Plugin finds the dependencies but Maven Javadoc Plugin doesn't

I try to generate the Java API documentation of a project composed of multiple sub-modules with mvn site but it doesn't work whereas mvn install works, it resolves all dependencies and it compiles successfully. mvn site resolves neither the dependencies that are inherited by all sub-modules in the parent pom file (including easymock) nor the dependencies specific to some sub-modules (including SWT).

I obtain the following error message: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.7.1:site (default-site) on project ardor3d: Error generating maven-javadoc-plugin:3.1.1:aggregate report: [ERROR] Exit code: 1 - /home/gouessej/Documents/programming/java/workspace/Ardor3D/ardor3d-swt/src/test/java/com/ardor3d/input/swt/TestSwtMouseWrapper.java:23: error: package org.eclipse.swt.events does not exist

I use Maven 3.6.1 with OpenJDK 11. This problem concerns the open source project JogAmp's Ardor3D Continuation and is reproducible with the latest source code.

I saw a similar question here but I don't think that the accepted answer helps in my case.

It worked with Java 8 but I'm not sure that it's the culprit.

PS: Reverting this change and using Java 8 work around this bug.

Replacing <release>8</release> by <source>1.8</source><target>1.8</target> and using Java 8 instead of Java 11 solve the problem. It's probably a bug of maven-javadoc-plugin with Java 11. This bug has been reported here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM