How to accomplish inheriting Javadoc comments from JDK with Gradle Javadoc task?

I want my Javadoc to inherit comments from standard JDK classes. For this, I need to add JDK sources to -sourcepath javadoc option. Not to generate documentation for JDK classes themselves, I would specify packages via -packagenames or -subpackages javadoc options, but Javadoc Gradle task doesn’t support them.

This question on SO: