Interface Mojo

All Known Implementing Classes:
AbstractMojo

public interface Mojo
This interface forms the contract required for Mojos to interact with the Maven infrastructure.
It features an execute() method, which triggers the Mojo's build-process behavior, and can throw a MojoExecutionException or MojoFailureException if error conditions occur.
Also included is the setLog(...) method, which simply allows Maven to inject a logging mechanism which will allow the Mojo to communicate to the outside world through standard Maven channels.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The component role hint for Plexus container
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Perform whatever build-process behavior this Mojo implements.
    This is the main trigger for the Mojo inside the Maven system, and allows the Mojo to communicate errors.
    Deprecated.
    Use SLF4J directly
    void
    setLog(Log log)
    Deprecated.
    Use SLF4J directly
  • Field Details

    • ROLE

      static final String ROLE
      The component role hint for Plexus container
  • Method Details

    • execute

      Perform whatever build-process behavior this Mojo implements.
      This is the main trigger for the Mojo inside the Maven system, and allows the Mojo to communicate errors.
      Throws:
      MojoExecutionException - if an unexpected problem occurs. Throwing this exception causes a "BUILD ERROR" message to be displayed.
      MojoFailureException - if an expected problem (such as a compilation failure) occurs. Throwing this exception causes a "BUILD FAILURE" message to be displayed.
    • setLog

      @Deprecated void setLog(Log log)
      Deprecated.
      Use SLF4J directly
      Inject a standard Maven logging mechanism to allow this Mojo to communicate events and feedback to the user.
      Parameters:
      log - a new logger
    • getLog

      @Deprecated Log getLog()
      Deprecated.
      Use SLF4J directly
      Furnish access to the standard Maven logging mechanism which is managed in this base class.
      Returns:
      a log4j-like logger object which allows plugins to create messages at levels of "debug", "info", "warn", and "error".