unitsofmeasurement / unit-api

Units of Measurement API
http://unitsofmeasurement.github.io/unit-api/
Other
180 stars 42 forks source link

Fix problem with maven-javadoc-plugin #220

Closed keilw closed 3 years ago

keilw commented 3 years ago

Since around July 2020, the maven-javadoc-plugin does not work properly both in a local environment and on the CI server. That results in an empty unit-api-X.Y.Z-SNAPSHOT-javadoc.jar being generated.

[ERROR] MavenReportException: Error while generating Javadoc:
Exit code: 2 - javadoc: error - No source files for package javax.measure

Command line was: cmd.exe /X /C ""C:\Program Files\AdoptOpenJDK\jdk-14.0.2.12-hotspot\bin\javadoc.exe" @options @packages"

Refer to the generated Javadoc files in 'C:\Users\Werner\git\unit-api\target\apidocs' dir.

org.apache.maven.reporting.MavenReportException:
Exit code: 2 - javadoc: error - No source files for package javax.measure

Command line was: cmd.exe /X /C ""C:\Program Files\AdoptOpenJDK\jdk-14.0.2.12-hotspot\bin\javadoc.exe" @options @packages"

Refer to the generated Javadoc files in 'C:\Users\Werner\git\unit-api\target\apidocs' dir.

At the moment the only workaround is to define source prior to Java 9 in the maven-javadoc-plugin, see https://github.com/assertj/assertj-core/issues/1403#issuecomment-742181492 Indriya does not seem affected, so another possible approach could be to also switch the API to the maven-toolchain-plugin, but that would add further complexity. If there is a new version of the Maven JavaDoc Plugin soon, that addresses these problems, it might be the easier way, otherwise we might have to apply the toolchain plugin here as well.