I am trying to use code snippets using external file. My documentation looks like this:
/**
* The following method uses the {@code HttpRequest.GET()} method. Please use it like follows:
* {@snippet class="ShowHttpClientExamples" region="restServicePost"}
*/
I have a directory named snippets-file
in the directory src/java/
and in my build.gradle
file I have he following code in the javadoc
task :
javadoc {
doFirst {
options.addStringOption('-snippet-path', "${rootDir}/src/java/snippet-files")
}
}
I am trying to specify the snippet-path
for the javadoc
task.
When I execute the task I get the error that class ShowHttpClientExamples
isn't found on the source path or snippet path.
I tried to create a directory first and then a package named snippet-files
inside the package containing the class containing the method documented with the @snippet
tag, all according to the guide. I still get the same error.
How to I use code snippets using external code file in Gradle with Application plugin?
I tried to follow this blog which is for Maven and tried to adapt for my case but the error still persists.