Gradle javadoc task no longer reports errors and warnings

(Sverre Moe) #1

My API project no longer reports the Javadoc WARNINGs and ERRORs when running gradle javadoc.

My other JavaFX project is reporting them.

I was content with my API having no Javadoc warnings or errors, but was distraught when I discovered wrong javadoc which should have produced an error and failed the build.

Both projects have same build script configuration regarding javadoc.

task sourcesJar(type: Jar, dependsOn: classes) {
    classifier = 'sources'
    from sourceSets.main.allSource

task javadocJar(type: Jar, dependsOn: javadoc) {
    classifier = 'javadoc'
    from javadoc.destinationDir

artifacts {
    archives jar
    archives sourcesJar
    archives javadocJar

Gradle 4.10
Java 1.8

(Sverre Moe) #2

Would appreciate if anyone have insight of what the problem might be with this one project.
Why isn’t javadoc task reporting warnings and errors?

I had to turn on Javadoc validation in Eclipse to make sure.
Edit: It caused so much errors on my other legacy applications that I had to turn it off again.

(Sverre Moe) #3

I have discovered the reason why Javadoc did not report warnings and errors on certain classes.

Javadoc does not run on package private classes (no access modifier).

Even though I have Javadoc in a package private class, it will be omitted from Javadoc, thus it will not report any warnings or errors.