Repository navigation
Description
Summary
The @After annotation (org.apache.maven.api.plugin.annotations.After, @since 4.0.0, @Experimental) exists in maven-api-core and the underlying Lifecycle.Link/Pointer model is already used internally by DefaultLifecycleRegistry to define the tree-based lifecycle. However, there is no processing pipeline that makes @After usable by plugin authors — it compiles but has zero runtime effect.
Missing pieces
1. Plugin descriptor model (plugin.mdo)
MojoDescriptor has no fields for after/link/pointer. Needs new elements to represent the ordering constraints declared by @After.
2. maven-plugin-tools annotation scanner
The annotation processor that generates META-INF/maven/plugin.xml from @Mojo/@Parameter annotations does not read @After at all. Needs to extract phase(), type(), and scope() from @After annotations on mojo classes and emit them into the descriptor.
3. Maven core plugin executor
Needs to read the new descriptor fields and create proper Lifecycle.Link entries (Kind.AFTER with the appropriate Pointer subtype) when loading plugin descriptors, so the concurrent builder can schedule mojos correctly.
Context
The internal lifecycle definition already uses the exact same model:
// DefaultLifecycleRegistry.java
phase(COMPILE, after(SOURCES), dependencies(SCOPE_COMPILE, READY)),
phase(READY, after(COMPILE), after(RESOURCES)),
phase(TEST_COMPILE, after(TEST_SOURCES), after(READY),
dependencies(SCOPE_TEST_ONLY, READY)),The intent of @After is to let plugin mojos declare the same ordering constraints:
@After(phase = "compile", type = After.Type.PROJECT)
@After(phase = "ready", type = After.Type.DEPENDENCIES, scope = "compile")
@Mojo(name = "my-goal")
public class MyMojo implements Mojo { ... }This would be particularly powerful with the concurrent builder — a mojo could express precise ordering constraints without being pinned to a single fixed phase.
Relevant source files
After.java—maven-api-coreannotation definitionLifecycle.java—Link,Pointer,PhasePointer,DependenciesPointer,ChildrenPointerLifecycles.java—after(),dependencies(),children()helper methodsDefaultLifecycleRegistry.java— tree-based lifecycle definition using those helpersplugin.mdo— plugin descriptor model (in maven-plugin-tools)
No plugin currently uses @After — searched all major Apache Maven plugins (compiler, surefire, dependency, javadoc, resources, jar, install, deploy, site, clean, shade, assembly, war, ear, enforcer).
Activity
Fix #12534: Wire up @after annotation processing in Maven core
Fix #12534: Wire up @after annotation processing in Maven core
Fix #12534: Wire up @after annotation processing in Maven core
Fix #12534: Wire up @after annotation processing in Maven core
Fix #12534: Wire up @after annotation processing in Maven core
Fix #12534: Wire up @after annotation processing in Maven core
[Backport 4.0.x] Fix #12534: Wire up @after annotation processing in …