1 package org.apache.maven.plugin.coreit;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.util.Iterator;
23 import java.util.List;
24
25 import org.apache.maven.plugin.AbstractMojo;
26 import org.apache.maven.plugin.MojoExecutionException;
27 import org.apache.maven.project.MavenProject;
28
29
30
31
32
33
34
35 public class ForkGoalAggregatorMojo
36 extends AbstractMojo
37 {
38
39
40
41 private MavenProject project;
42
43
44
45
46 private List reactorProjects;
47
48 public void execute()
49 throws MojoExecutionException
50 {
51 for ( Iterator it = reactorProjects.iterator(); it.hasNext(); )
52 {
53 MavenProject executedProject = ( (MavenProject) it.next() ).getExecutionProject();
54
55 if ( !executedProject.getBuild().getFinalName().equals( TouchMojo.FINAL_NAME ) )
56 {
57 throw new MojoExecutionException( "Unexpected result, final name of executed project "
58 + executedProject + " is " + executedProject.getBuild().getFinalName() + " (should be \'"
59 + TouchMojo.FINAL_NAME + "\')." );
60 }
61 }
62
63 if ( project.getBuild().getFinalName().equals( TouchMojo.FINAL_NAME ) )
64 {
65 throw new MojoExecutionException( "forked project was polluted. (should NOT be \'" + TouchMojo.FINAL_NAME
66 + "\')." );
67 }
68 }
69 }