I’m trying to port a Maven build to Gradle. I wrote a custom taglet in a separate project that this project references as a GAV (in the Maven build, at least). I’m trying to figure out how to translate this to the javadoc task in Gradle. I see the “tagletPath” list property, but that’s just a list of Files. How can I reference an artifact here?
If it matters, the reference in the original maven-javadoc-plugin looks like this:
When I first saw this reply, I realized you were surely right. I’ve been away from this for a while, and forgot about how to use configurations and “.files”.
Unfortunately, although this produces what I expect, it still fails.
A problem occurred evaluating root project ‘usl-parent’.
Could not find method tagletPath() for arguments [[….m2\repository\com\att\detsusl\taglets\validationJavadocTaglet\0.0.1-SNAPSHOT\validationJavadocTaglet-0.0.1-SNAPSHOT.jar, ….m2\repository\org\hibernate\hibernate-validator\5.4.1.Final\hibernate-validator-5.4.1.Final.jar, …]] on object of type org.gradle.external.javadoc.StandardJavadocDocletOptions.
I can’t tell from this output whether it truly created “File” objects or just Strings. I can see from the “StandardJavadocDocletOptions” class that it requires File objects. I would assume that “files” would do that, but I don’t know what might be wrong here.
Calling files on a configuration returns a Set<File>, but tagletPath expects a List<File> or varargs File..., so your problem is likely with the wrapper, not the contents.
I don’t get to Groove every often (invented a new verb there ), so I didn’t think of this.
From a practical point of view, would it be reasonable to suggest that DSL functions (or functions that are likely to be called from a Gradle build script) that take a “List” parameter should also have a “Set” version, as there are likely many cases where “.files” would be the input for it?