1 package org.apache.maven.plugin;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.apache.maven.model.Plugin;
23
24
25
26
27 public class PluginDescriptorParsingException
28 extends Exception
29 {
30
31 public PluginDescriptorParsingException( Plugin plugin, String descriptorLocation, Throwable e )
32 {
33 super( createMessage( plugin, descriptorLocation, e ), e );
34 }
35
36 private static String createMessage( Plugin plugin, String descriptorLocation, Throwable e )
37 {
38 String message = "Failed to parse plugin descriptor";
39
40 if ( plugin != null )
41 {
42 message += " for " + plugin.getId();
43 }
44
45 if ( descriptorLocation != null )
46 {
47 message += " (" + descriptorLocation + ")";
48 }
49
50 if ( e != null )
51 {
52 message += ": " + e.getMessage();
53 }
54
55 return message;
56 }
57
58 }