'Javadoc failOnError not working with Java 11
I’m working in an Android library where its Javadoc documentation is part of its requirement. In this Javadoc I don’t want to show all classes since most of them are obfuscated and for that reason I pick up the ones I want to include in the Javadoc;
task("generate${variant.name.capitalize()}Javadoc", type: Javadoc) {
description "Generates Javadoc for $variant.name."
source = android.sourceSets.main.java.sourceFiles
ext.androidJar =
"${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar"
classpath = files(variant.javaCompiler.classpath.files) + files(ext.androidJar)
failOnError = false
options {
links "http://docs.oracle.com/javase/7/docs/api/"
linksOffline "http://d.android.com/reference",
"${android.sdkDirectory}/docs/reference"
}
include '**/sdk/common/Result.java'
include '**/sdk/common/Params.java'
include '**/sdk/model/Car.java'
include '**/sdk/model/Result.java'
include '**/sdk/car/*.java'
exclude '**/sdk/car/Service.java'
}
In theory, failOnError allows us to create the Javadoc assuming and ignoring the referenced obfuscated classes errors (class X not found). Everything works as expected working with Java 1.8, where although we get some gradle errors with referenced obfuscated classes errors, the final Javadoc is completed.
For some project requirements, I need to upgrade to Java 11. In this case, the Javadoc process is stopped with the same gradle errors and no Javadoc is created.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
