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