org.apache.maven
Class MavenException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byorg.apache.maven.MavenException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ChecksumVerificationException, GoalException, RepoConfigException, UnknownPluginException, UnsatisfiedDependencyException

public class MavenException
extends java.lang.Exception

The base class for all exceptions thrown by MavenSession. Taken liberally from Ant's BuildException

Version:
$Id: MavenException.java,v 1.4.10.2 2004/03/01 22:36:36 evenisse Exp $
See Also:
Serialized Form

Constructor Summary
MavenException()
          Creates a new instance of MavenException without detail message.
MavenException(java.lang.String msg)
          Constructs an instance of MavenException with the specified detail message.
MavenException(java.lang.String message, java.lang.Throwable cause)
          Constructs an exception with the given message and exception as a root cause.
MavenException(java.lang.Throwable cause)
          Constructs an exception with the given exception as a root cause.
 
Method Summary
 java.lang.Throwable getException()
          Returns the nested exception, if any.
 void printStackTrace()
          Prints the stack trace for this exception and any nested exception to System.err.
 void printStackTrace(java.io.PrintStream ps)
          Prints the stack trace of this exception and any nested exception to the specified PrintStream.
 void printStackTrace(java.io.PrintWriter pw)
          Prints the stack trace of this exception and any nested exception to the specified PrintWriter.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MavenException

public MavenException()
Creates a new instance of MavenException without detail message.


MavenException

public MavenException(java.lang.String msg)
Constructs an instance of MavenException with the specified detail message.

Parameters:
msg - the detail message.

MavenException

public MavenException(java.lang.String message,
                      java.lang.Throwable cause)
Constructs an exception with the given message and exception as a root cause.

Parameters:
message - A description of or information about the exception. Should not be null unless a cause is specified.
cause - The exception that might have caused this one. May be null.

MavenException

public MavenException(java.lang.Throwable cause)
Constructs an exception with the given exception as a root cause.

Parameters:
cause - The exception that might have caused this one. Should not be null.
Method Detail

getException

public java.lang.Throwable getException()
Returns the nested exception, if any.

Returns:
the nested exception, or null if no exception is associated with this one

printStackTrace

public void printStackTrace()
Prints the stack trace for this exception and any nested exception to System.err.


printStackTrace

public void printStackTrace(java.io.PrintStream ps)
Prints the stack trace of this exception and any nested exception to the specified PrintStream.

Parameters:
ps - The PrintStream to print the stack trace to. Must not be null.

printStackTrace

public void printStackTrace(java.io.PrintWriter pw)
Prints the stack trace of this exception and any nested exception to the specified PrintWriter.

Parameters:
pw - The PrintWriter to print the stack trace to. Must not be null.


Copyright © 2001-2005 Apache Software Foundation. All Rights Reserved.