1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.plugin;
20
21 import java.util.List;
22 import java.util.stream.Collectors;
23
24 import org.apache.maven.model.Plugin;
25
26
27
28
29
30
31 public class PluginResolutionException extends Exception {
32
33 private final Plugin plugin;
34
35 public PluginResolutionException(Plugin plugin, Throwable cause) {
36 super(
37 "Plugin " + plugin.getId() + " or one of its dependencies could not be resolved: " + cause.getMessage(),
38 cause);
39 this.plugin = plugin;
40 }
41
42 public PluginResolutionException(Plugin plugin, List<Exception> exceptions, Throwable cause) {
43 super(
44 "Plugin " + plugin.getId() + " or one of its dependencies could not be resolved:"
45 + System.lineSeparator() + "\t"
46 + exceptions.stream()
47 .map(Throwable::getMessage)
48 .collect(Collectors.joining(System.lineSeparator() + "\t"))
49 + System.lineSeparator(),
50 cause);
51 this.plugin = plugin;
52 }
53
54 public Plugin getPlugin() {
55 return plugin;
56 }
57 }