Interface Event


@Experimental public interface Event
Event sent by maven during various phases of the build process. Such events can be listened to using Listeners objects registered in the Session.
Since:
4.0.0
  • Method Details

    • getType

      @Nonnull EventType getType()
      Gets the type of the event.
      Returns:
      the type of the event, never null
    • getSession

      @Nonnull Session getSession()
      Gets the session from which this event originates.
      Returns:
      the current session, never null
    • getProject

      @Nonnull Optional<Project> getProject()
      Gets the current project (if any).
      Returns:
      the current project or empty() if not applicable
    • getMojoExecution

      @Nonnull Optional<MojoExecution> getMojoExecution()
      Gets the current mojo execution (if any).
      Returns:
      the current mojo execution or empty() if not applicable
    • getException

      Optional<Exception> getException()
      Gets the exception that caused the event (if any).
      Returns:
      the exception or empty() if none