1 package org.apache.maven.tools.plugin.extractor.model;
2
3 /*
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
19 * under the License.
20 */
21
22 import java.io.File;
23
24 /**
25 * Exception when plugin metadata parsing occurred.
26 *
27 * @deprecated Scripting support for mojos is deprecated and is planned tp be removed in maven 4.0
28 */
29 @Deprecated
30 public class PluginMetadataParseException
31 extends Exception
32 {
33 /** serialVersionUID */
34 static final long serialVersionUID = 4022348153707995574L;
35
36 private final File metadataFile;
37
38 private final String originalMessage;
39
40 /**
41 * @param metadataFile could be null
42 * @param message could be null
43 * @param cause could be null
44 */
45 public PluginMetadataParseException( File metadataFile, String message, Throwable cause )
46 {
47 super( "Error parsing file: " + metadataFile + ". Reason: " + message, cause );
48
49 this.metadataFile = metadataFile;
50 this.originalMessage = message;
51 }
52
53 /**
54 * @param metadataFile could be null
55 * @param message could be null
56 */
57 public PluginMetadataParseException( File metadataFile, String message )
58 {
59 super( "Error parsing file: " + metadataFile + ". Reason: " + message );
60
61 this.metadataFile = metadataFile;
62 this.originalMessage = message;
63 }
64
65 /**
66 * @return the metadata file
67 */
68 public File getMetadataFile()
69 {
70 return metadataFile;
71 }
72
73 /**
74 * @return the original message
75 */
76 public String getOriginalMessage()
77 {
78 return originalMessage;
79 }
80 }