001 package org.apache.maven.plugin; 002 003 /* 004 * Licensed to the Apache Software Foundation (ASF) under one 005 * or more contributor license agreements. See the NOTICE file 006 * distributed with this work for additional information 007 * regarding copyright ownership. The ASF licenses this file 008 * to you under the Apache License, Version 2.0 (the 009 * "License"); you may not use this file except in compliance 010 * with the License. You may obtain a copy of the License at 011 * 012 * http://www.apache.org/licenses/LICENSE-2.0 013 * 014 * Unless required by applicable law or agreed to in writing, 015 * software distributed under the License is distributed on an 016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 017 * KIND, either express or implied. See the License for the 018 * specific language governing permissions and limitations 019 * under the License. 020 */ 021 022 /** 023 * An exception occurring during the execution of a plugin. 024 * <br/> 025 * Throwing this exception causes a "BUILD ERROR" message to be displayed. 026 * 027 * @author Brett Porter 028 */ 029 public class MojoExecutionException 030 extends AbstractMojoExecutionException 031 { 032 /** 033 * Construct a new <code>MojoExecutionException</code> exception providing the source and a short and long message: 034 * these messages are used to improve the message written at the end of Maven build. 035 * 036 * @param source 037 * @param shortMessage 038 * @param longMessage 039 */ 040 public MojoExecutionException( Object source, String shortMessage, String longMessage ) 041 { 042 super( shortMessage ); 043 this.source = source; 044 this.longMessage = longMessage; 045 } 046 047 /** 048 * Construct a new <code>MojoExecutionException</code> exception wrapping an underlying <code>Exception</code> 049 * and providing a <code>message</code>. 050 * 051 * @param message 052 * @param cause 053 */ 054 public MojoExecutionException( String message, Exception cause ) 055 { 056 super( message, cause ); 057 } 058 059 /** 060 * Construct a new <code>MojoExecutionException</code> exception wrapping an underlying <code>Throwable</code> 061 * and providing a <code>message</code>. 062 * 063 * @param message 064 * @param cause 065 */ 066 public MojoExecutionException( String message, Throwable cause ) 067 { 068 super( message, cause ); 069 } 070 071 /** 072 * Construct a new <code>MojoExecutionException</code> exception providing a <code>message</code>. 073 * 074 * @param message 075 */ 076 public MojoExecutionException( String message ) 077 { 078 super( message ); 079 } 080 }