Class MojoExecutionStub
java.lang.Object
org.apache.maven.api.plugin.testing.stubs.MojoExecutionStub
- All Implemented Interfaces:
MojoExecution
A stub implementation of
MojoExecution
for testing Maven plugins.
This class provides a simplified representation of a Mojo execution context,
allowing tests to simulate plugin executions without a full Maven environment.
Example usage:
MojoExecutionStub execution = new MojoExecutionStub("myExecution", "myGoal"); execution.setPlugin(new PluginStub()); execution.setDescriptor(mojoDescriptor);
- Since:
- 4.0.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMojoExecutionStub
(String executionId, String goal) MojoExecutionStub
(String executionId, String goal, XmlNode dom) -
Method Summary
Modifier and TypeMethodDescriptiongetGoal()
getModel()
void
setDescriptor
(MojoDescriptor descriptor) void
void
setExecutionId
(String executionId) void
void
setLifecyclePhase
(String lifecyclePhase) void
setModel
(PluginExecution model) void
-
Constructor Details
-
MojoExecutionStub
-
MojoExecutionStub
-
-
Method Details
-
getPlugin
- Specified by:
getPlugin
in interfaceMojoExecution
-
getModel
- Specified by:
getModel
in interfaceMojoExecution
-
getDescriptor
- Specified by:
getDescriptor
in interfaceMojoExecution
-
getLifecyclePhase
- Specified by:
getLifecyclePhase
in interfaceMojoExecution
-
getExecutionId
- Specified by:
getExecutionId
in interfaceMojoExecution
-
getGoal
- Specified by:
getGoal
in interfaceMojoExecution
-
getConfiguration
- Specified by:
getConfiguration
in interfaceMojoExecution
-
setExecutionId
-
setGoal
-
setDom
-
setPlugin
-
setModel
-
setDescriptor
-
setLifecyclePhase
-