You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Extract Mojo metadata with a custom doclet instead of javaparser and ASM #1277
Mojo descriptors are built with two third-party libraries: ASM reads the annotations from bytecode (DefaultMojoAnnotationsScanner and its visitors), and javaparser-core with the symbol solver reads Javadoc from sources (JavaSourceModel, the converter package).
Proposal: a custom doclet on the JDK's jdk.javadoc.doclet API, run in process through ToolProvider.getSystemDocumentationTool(), as the configuration collector in apache/maven-resolver@46da42c does. The doclet would:
read @Mojo, @Parameter, @Component and @Execute as javax.lang.model elements, so ASM can go;
convert the description and the standard tags (@since, @deprecated, @see, inline {@link}, {@code}, {@value}) from DocTree nodes into the descriptor's description, since and deprecated fields;
pick up Markdown doc comments (///) when it runs on JDK 23 or later.
Open questions:
Mojos that extend classes from dependencies: the doclet has no source for them, so ASM or a -sources.jar lookup may have to stay for that path.
The doclet API needs JDK 9 or later; the 3.x line targets Java 8.
The annotation processor approach suggested in Replace or drop using of qdox #1080 is the alternative. The doclet runs from the plugin goal and does not change how users compile.
Done when the plugin descriptors and plugin-help.xml produced by the existing ITs are unchanged, and maven-plugin-tools-annotations no longer depends on javaparser or ASM.
Javadoc extraction without source: That does not work with neither QDox/javaparser-core, so no regression. Would be good to emit a warning in that case, though
Annotation processor, whether the plugin descriptor is called from an Annotation processor or from a Mojo should only have minor impact as in both cases the custom doclet would need to be called.
Activity
kwin commentedon Nov 15, 2026
Regarding the questions: