Skip to content

Commit

Permalink
Ignore JavaDoc doclint errors which kill release under Java 8
Browse files Browse the repository at this point in the history
The Bouncy Castle project has dozens of javadoc errors which doclint
tolerated under Java 7 but are now fatal under Java 8. When releasing to
Maven Central (using `gradle uploadArchives`) the `javadoc` task gets run,
and will fail when running under Java 8, blocking the release.

The solution here was taken from Stephen Colebourne's blog:

http://blog.joda.org/2014/02/turning-off-doclint-in-jdk-8-javadoc.html

See also:

http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#quiet

Several of the javadoc errors in Bouncy Castle are valid - for instance:

```
core/src/main/java/org/bouncycastle/pqc/crypto/mceliece/McElieceCipher.java:160:
error: exception not thrown: java.lang.Exception
     * @throws Exception if the cipher text is invalid.
```

You can quickly see these by running `gradle javadoc` under Java 8.
  • Loading branch information
rtyley committed Aug 30, 2017
1 parent 9c3baae commit a7ce0a0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ buildscript {
}
}

if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}

allprojects {
apply plugin: 'java'
apply plugin: 'idea'
Expand Down

0 comments on commit a7ce0a0

Please sign in to comment.