001package 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 (such as a compilation failure). 024 * <br/> 025 * Throwing this exception causes a "BUILD FAILURE" message to be displayed. 026 * 027 * @author Brett Porter 028 */ 029public class MojoFailureException 030 extends AbstractMojoExecutionException 031{ 032 /** 033 * Construct a new <code>MojoFailureException</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 MojoFailureException( 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>MojoFailureException</code> exception providing a message. 049 * 050 * @param message 051 */ 052 public MojoFailureException( String message ) 053 { 054 super( message ); 055 } 056 057 /** 058 * Construct a new <code>MojoFailureException</code> exception wrapping an underlying <code>Throwable</code> 059 * and providing a <code>message</code>. 060 * 061 * @param message 062 * @param cause 063 * @since 2.0.9 064 */ 065 public MojoFailureException( String message, Throwable cause ) 066 { 067 super( message, cause ); 068 } 069}