Wire up @After annotation scanning in the annotation-based descriptor extractor - #1137
Open
gnodet wants to merge 1 commit into
Open
Wire up @After annotation scanning in the annotation-based descriptor extractor#1137gnodet wants to merge 1 commit into
gnodet wants to merge 1 commit into
Conversation
… extractor The v4 API @after annotation (and its @repeatable container @afters) was not recognized by the annotation scanner, so plugins using @after had to hand-craft the <afterLink> descriptor entries. This commit adds end-to-end support: - MojoAnnotationsScanner: register @after / @afters in CLASS_LEVEL_ANNOTATIONS - AfterAnnotationContent: new datamodel POJO holding phase/type/scope - MojoAnnotatedClass: add List<AfterAnnotationContent> field - MojoAnnotationVisitor: track nested annotation visitors returned from visitAnnotation() and array sub-visitors from visitArray(), so the @afters repeatable container can be unpacked - DefaultMojoAnnotationsScanner.analyzeVisitors(): extract single @after and @afters container into AfterAnnotationContent objects - ExtendedMojoDescriptor: add AfterLink inner class and addAfterLink() - JavaAnnotationsMojoDescriptorExtractor.toMojoDescriptors(): walk the class hierarchy collecting @after annotations and map them to AfterLink - PluginDescriptorFilesGenerator: emit <afterLinks>/<afterLink> elements in the v4 plugin descriptor Complements apache/maven#12535 which adds the model (AfterLink), runtime processing (BuildPlanExecutor.applyAfterLinks), and an IT that currently hand-crafts the descriptor. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
gnodet
marked this pull request as ready for review
July 26, 2026 16:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@After/@Afters(v4 API) inCLASS_LEVEL_ANNOTATIONSso the ASM scanner picks them upAfterAnnotationContentdatamodel class andList<AfterAnnotationContent>field onMojoAnnotatedClassMojoAnnotationVisitorto track nested annotation visitors (needed to unpack the@Aftersrepeatable container)@Afterand@Afterscontainer inDefaultMojoAnnotationsScanner.analyzeVisitors()@Afterannotations and map them toExtendedMojoDescriptor.AfterLinkinJavaAnnotationsMojoDescriptorExtractor.toMojoDescriptors()<afterLinks>/<afterLink>elements in the v4 plugin descriptor viaPluginDescriptorFilesGeneratorComplements apache/maven#12535 which adds the model (
AfterLinkinplugin.mdo), runtime processing (BuildPlanExecutor.applyAfterLinks),@Repeatablesupport on@After, and an IT that currently hand-crafts the descriptor because the scanner did not exist yet.Test plan
🤖 Generated with Claude Code