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-core annotation definition
Lifecycle.java — Link, Pointer, PhasePointer, DependenciesPointer, ChildrenPointer
Lifecycles.java — after(), dependencies(), children() helper methods
DefaultLifecycleRegistry.java — tree-based lifecycle definition using those helpers
plugin.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).
Summary
The
@Afterannotation (org.apache.maven.api.plugin.annotations.After,@since 4.0.0,@Experimental) exists inmaven-api-coreand the underlyingLifecycle.Link/Pointermodel is already used internally byDefaultLifecycleRegistryto define the tree-based lifecycle. However, there is no processing pipeline that makes@Afterusable by plugin authors — it compiles but has zero runtime effect.Missing pieces
1. Plugin descriptor model (
plugin.mdo)MojoDescriptorhas 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.xmlfrom@Mojo/@Parameterannotations does not read@Afterat all. Needs to extractphase(),type(), andscope()from@Afterannotations 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.Linkentries (Kind.AFTERwith the appropriatePointersubtype) when loading plugin descriptors, so the concurrent builder can schedule mojos correctly.Context
The internal lifecycle definition already uses the exact same model:
The intent of
@Afteris to let plugin mojos declare the same ordering constraints: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).