Javadoc does not recognize doctitle option/flag

人盡茶涼 提交于 2019-12-05 12:01:49

EDITED:

Got it! The problem was in the Doclet itself. I was not extending the Standard Doclet ("public class MyDoclet extends Standard {"), so the flags from the Standard Doclet were not available (and doctitle is part of the flags of the Standard Doclet).

Thanks to Paulo for making me "re-think" my answer :-)

You can set the task local variable 'title' to empty on the javadoc task

task javadocTask(type: Javadoc) {
    title = ""
    //Other items like source and options
}

Or alternatively

javadocTask.title = ""

Why

Gradle sets the local variable 'title' in the javadoc task that is then used to populate the -doctitle and -windowtitle arguments. If it is empty, they will not populate the fields and you can avoid this problem.

Interestingly, title seems to be populated by the java plugin, so if you are running javadoc from a project that does not have java (say as an aggregator project) you will not run into this problem, but if you move the javadoc generation into a java project you will.

Note: title = "" and title = null both work on the newest version of gradle. This is likely because gradle knows both "" and null are empty. However, on older versions of gradle, there are reports of using null not working, but an empty string did.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!