The project.apiDocTitle property is mentioned in docs but not found

According to current documentation for groovydoc and javadoc tasks, groovydoc.windowTitle, groovydoc.docTitle, and javadoc.title properties are set to project.apiDocTitle value by default. But when I try to access this property, I get the error Could not find property 'apiDocTitle' on root project.

Thanks, try reporting.apiDocTitle instead. Some documentation got missed as part of 2.0. I’ll clean that up now.

And it seems that ReportingExtension DSL doc is incomplete (corresponding javadoc mentions more methods).

Is it possible to set apiDocTitle to "Some String ${project.version}"? As far as I understand the only way to set it is to add something like rootProject.reporting.apiDocTitle = "Some String ${rootProject.version}" in settings.gradle, but I can’t figure out how to acces the reporting extension and project version in settings.gradle

Unfortunately, the apiDocTitle isn’t configurable right now, so the easiest thing to do is to configure each of the doc tasks.


def myTitle = "Some String ${project.version}"
tasks.withType(Javadoc) { 
   title = myTitle

tasks.withType(Groovydoc) {
   docTitle = myTitle

(you can also just use the task name, if you know what it is)

You almost never configure anything in a settings.gradle file except for the root project name and to include subprojects. The “backing object” for a settings.gradle file is the Settings class, so you don’t have access to a project object to configure and settings.gradle is evaluated before any build scripts.

1 Like