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, org.apache.maven.api.xml.XmlNode dom) -
Method Summary
Modifier and TypeMethodDescriptionOptional
<org.apache.maven.api.xml.XmlNode> org.apache.maven.api.plugin.descriptor.MojoDescriptor
getGoal()
getModel()
void
setDescriptor
(org.apache.maven.api.plugin.descriptor.MojoDescriptor descriptor) void
setDom
(org.apache.maven.api.xml.XmlNode dom) 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
public org.apache.maven.api.plugin.descriptor.MojoDescriptor 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
public void setDom(org.apache.maven.api.xml.XmlNode dom) -
setPlugin
-
setModel
-
setDescriptor
public void setDescriptor(org.apache.maven.api.plugin.descriptor.MojoDescriptor descriptor) -
setLifecyclePhase
-