Class ProjectBuildLogAppender

java.lang.Object
org.apache.maven.logging.ProjectBuildLogAppender
All Implemented Interfaces:
AutoCloseable

public class ProjectBuildLogAppender extends Object implements AutoCloseable
Forwards log messages to the client.
  • Constructor Details

    • ProjectBuildLogAppender

      public ProjectBuildLogAppender(BuildEventListener buildEventListener)
  • Method Details

    • getProjectId

      public static String getProjectId()
    • setProjectId

      public static void setProjectId(String projectId)
    • getMojoId

      public static String getMojoId()
    • setMojoId

      public static void setMojoId(String mojoId)
      Sets or clears the mojo execution identifier in both the thread-local and the SLF4J MDC. When clearing (null), if a forking mojo ID was saved, it is restored — mirroring the fork-aware project ID pattern.

      Format: "prefix:goal@executionId" (e.g. "compiler:compile@default-compile").

      Parameters:
      mojoId - the mojo identifier, or null to clear
    • setForkingProjectId

      public static void setForkingProjectId(String forkingProjectId)
    • setForkingMojoId

      public static void setForkingMojoId(String forkingMojoId)
      Saves or clears the mojo ID of the forking mojo, so it can be restored when the fork completes. Mirrors the setForkingProjectId(String) pattern for project IDs.
      Parameters:
      forkingMojoId - the forking mojo identifier, or null to clear
    • updateMdc

      public static void updateMdc()
    • accept

      protected void accept(String message)
    • close

      public void close() throws Exception
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception