1 package org.apache.maven.plugin.javadoc.stubs;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.io.File;
23 import java.util.ArrayList;
24 import java.util.Collections;
25 import java.util.List;
26 import java.util.Set;
27
28 import org.apache.maven.artifact.Artifact;
29 import org.apache.maven.artifact.factory.ArtifactFactory;
30 import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
31 import org.apache.maven.model.Build;
32 import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
33 import org.apache.maven.project.MavenProject;
34 import org.apache.maven.project.artifact.InvalidDependencyVersionException;
35
36
37
38
39 public class AggregateProject2TestMavenProjectStub
40 extends MavenProjectStub
41 {
42 private Build build;
43
44 public AggregateProject2TestMavenProjectStub()
45 {
46 setGroupId( "aggregate.test" );
47 setArtifactId( "aggregate-test-project2" );
48 setVersion( "1.0-SNAPSHOT" );
49 setPackaging( "jar" );
50 setExecutionRoot( true );
51
52 Artifact artifact = new JavadocPluginArtifactStub( getGroupId(), getArtifactId(), getVersion(), getPackaging() );
53 artifact.setArtifactHandler( new DefaultArtifactHandlerStub() );
54 setArtifact( artifact );
55
56 build = new Build();
57 build.setFinalName( "aggregate-test-project2" );
58 build.setDirectory( super.getBasedir() + "/target/test/unit/aggregate-test/target" );
59
60 String basedir = getBasedir().getAbsolutePath();
61 List compileSourceRoots = new ArrayList();
62 compileSourceRoots.add( basedir + "/aggregate/test/project2" );
63 setCompileSourceRoots( compileSourceRoots );
64 }
65
66
67
68
69 public Build getBuild()
70 {
71 return build;
72 }
73
74
75
76
77 public void setBuild( Build build )
78 {
79 this.build = build;
80 }
81
82
83
84
85
86 public Set createArtifacts( ArtifactFactory artifactFactory, String string, ArtifactFilter artifactFilter )
87 throws InvalidDependencyVersionException
88 {
89 return Collections.EMPTY_SET;
90 }
91
92
93
94
95 public File getBasedir()
96 {
97 return new File( super.getBasedir() + "/src/test/resources/unit/aggregate-test/project2" );
98 }
99
100
101
102
103 public MavenProject getExecutionProject()
104 {
105 return this;
106 }
107 }