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 @Override
35 public void beforeMojoExecution(MojoExecutionEvent event) throws MojoExecutionException {
36 for (MojoExecutionListener listener : listeners) {
37 listener.beforeMojoExecution(event);
38 }
39 }
40
41 @Override
42 public void afterMojoExecutionSuccess(MojoExecutionEvent event) throws MojoExecutionException {
43 for (MojoExecutionListener listener : listeners) {
44 listener.afterMojoExecutionSuccess(event);
45 }
46 }
47
48 @Override
49 public void afterExecutionFailure(MojoExecutionEvent event) {
50 for (MojoExecutionListener listener : listeners) {
51 listener.afterExecutionFailure(event);
52 }
53 }
54 }