Package org.apache.maven.api.plugin
Interface Mojo
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Represents the contract for Mojos to interact with the Maven infrastructure.
Implementations of this interface define specific build-process behaviors
that are triggered during a Maven build lifecycle.
The primary entry point is the
execute()
method, which encapsulates
the behavior of the Mojo and serves as the integration point with Maven. This
method may throw an Exception
to signal any issues that prevent
successful execution of the Mojo.
Annotations:
Experimental
: Indicates that this interface or its implementation may still be evolving and could change in future versions.FunctionalInterface
: Denotes that this is a functional interface, allowing implementations as lambda expressions or method references.Consumer
: Signifies that this type is intended to be implemented or extended by Maven plugins or extensions and consumed by Maven itself.ThreadSafe
: Implies that implementations of this interface must be safe to invoke from multiple threads concurrently.
- Since:
- 4.0.0
-
Method Summary
-
Method Details
-
execute
Executes the behavior defined by thisMojo
. This method is invoked during the Maven build lifecycle to perform the Mojo's designated task.Implementations should handle any task-specific logic and may communicate errors by throwing an
Exception
. Error conditions should provide sufficient detail to aid troubleshooting.- Throws:
Exception
- if any issue occurs that prevents the successful execution of the Mojo
-