Class MavenBuilderException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
SettingsBuilderException, ToolchainsBuilderException

@Experimental public abstract class MavenBuilderException extends MavenException
Base class for all maven exceptions carrying BuilderProblems.
Since:
4.0.0
See Also:
  • Constructor Details

    • MavenBuilderException

      public MavenBuilderException(String message, Throwable cause)
      Constructs a new exception with the specified message and cause. This constructor creates an empty problem collector.
      Parameters:
      message - the detail message
      cause - the cause of this exception
    • MavenBuilderException

      public MavenBuilderException(String message, ProblemCollector<BuilderProblem> problems)
      Constructs a new exception with the specified message and problems. The message will be enhanced with details from the problems.
      Parameters:
      message - the detail message
      problems - the collection of problems associated with this exception
  • Method Details

    • buildMessage

      protected static String buildMessage(String message, ProblemCollector<BuilderProblem> problems)
      Formats message out of problems: problems are sorted (in natural order of BuilderProblem.Severity) and then a list is built. These exceptions are usually thrown in "fatal" cases (and usually prevent Maven from starting), and these exceptions may end up very early on output.
      Parameters:
      message - the base message to enhance
      problems - the collection of problems to include in the message
      Returns:
      a formatted message including details of all problems
    • getProblemCollector

      public ProblemCollector<BuilderProblem> getProblemCollector()
      Returns the problem collector associated with this exception.
      Returns:
      the problem collector containing all problems related to this exception