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.Collection;
22
23 import org.apache.maven.execution.MojoExecutionEvent;
24 import org.apache.maven.execution.MojoExecutionListener;
25
26 class CompoundMojoExecutionListener implements MojoExecutionListener {
27
28 private final Collection<MojoExecutionListener> listeners;
29
30 CompoundMojoExecutionListener(Collection<MojoExecutionListener> listeners) {
31 this.listeners = listeners;
32 }
33
34 public void beforeMojoExecution(MojoExecutionEvent event) throws MojoExecutionException {
35 for (MojoExecutionListener listener : listeners) {
36 listener.beforeMojoExecution(event);
37 }
38 }
39
40 public void afterMojoExecutionSuccess(MojoExecutionEvent event) throws MojoExecutionException {
41 for (MojoExecutionListener listener : listeners) {
42 listener.afterMojoExecutionSuccess(event);
43 }
44 }
45
46 public void afterExecutionFailure(MojoExecutionEvent event) {
47 for (MojoExecutionListener listener : listeners) {
48 listener.afterExecutionFailure(event);
49 }
50 }
51 }