1 package org.apache.maven.plugin.javadoc.resolver;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.apache.maven.artifact.factory.ArtifactFactory;
23 import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
24 import org.apache.maven.artifact.repository.ArtifactRepository;
25 import org.apache.maven.artifact.resolver.ArtifactResolver;
26 import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
27 import org.apache.maven.plugin.logging.Log;
28 import org.apache.maven.project.MavenProject;
29 import org.codehaus.plexus.archiver.manager.ArchiverManager;
30
31 import java.io.File;
32 import java.util.List;
33
34
35
36
37 public class SourceResolverConfig
38 {
39
40 private final MavenProject project;
41
42 private ArtifactFilter filter;
43
44 private List<MavenProject> reactorProjects;
45
46 private final File outputBasedir;
47
48 private boolean compileSourceIncluded;
49
50 private boolean testSourceIncluded;
51
52 private final ArtifactRepository localRepository;
53
54 private final ArtifactResolver artifactResolver;
55
56 private final ArtifactMetadataSource artifactMetadataSource;
57
58 private final ArchiverManager archiverManager;
59
60 private final ArtifactFactory artifactFactory;
61
62 private final Log log;
63
64
65
66
67
68
69
70
71
72
73
74 public SourceResolverConfig( final Log log, final MavenProject project, final ArtifactRepository localRepository,
75 final File outputBasedir, final ArtifactResolver artifactResolver,
76 final ArtifactFactory artifactFactory,
77 final ArtifactMetadataSource artifactMetadataSource,
78 final ArchiverManager archiverManager )
79 {
80 this.log = log;
81 this.project = project;
82 this.localRepository = localRepository;
83 this.outputBasedir = outputBasedir;
84 this.artifactResolver = artifactResolver;
85 this.artifactFactory = artifactFactory;
86 this.artifactMetadataSource = artifactMetadataSource;
87 this.archiverManager = archiverManager;
88 }
89
90
91
92
93
94 public SourceResolverConfig withFilter( final ArtifactFilter filter )
95 {
96 this.filter = filter;
97 return this;
98 }
99
100
101
102
103
104 public SourceResolverConfig withReactorProjects( final List<MavenProject> reactorProjects )
105 {
106 this.reactorProjects = reactorProjects;
107 return this;
108 }
109
110
111
112
113 public SourceResolverConfig withCompileSources()
114 {
115 compileSourceIncluded = true;
116 return this;
117 }
118
119
120
121
122 public SourceResolverConfig withoutCompileSources()
123 {
124 compileSourceIncluded = false;
125 return this;
126 }
127
128
129
130
131 public SourceResolverConfig withTestSources()
132 {
133 testSourceIncluded = true;
134 return this;
135 }
136
137
138
139
140 public SourceResolverConfig withoutTestSources()
141 {
142 testSourceIncluded = false;
143 return this;
144 }
145
146
147
148
149 public MavenProject project()
150 {
151 return project;
152 }
153
154
155
156
157 public ArtifactRepository localRepository()
158 {
159 return localRepository;
160 }
161
162
163
164
165 public ArtifactFilter filter()
166 {
167 return filter;
168 }
169
170
171
172
173 public List<MavenProject> reactorProjects()
174 {
175 return reactorProjects;
176 }
177
178
179
180
181 public File outputBasedir()
182 {
183 return outputBasedir;
184 }
185
186
187
188
189 public boolean includeCompileSources()
190 {
191 return compileSourceIncluded;
192 }
193
194
195
196
197 public boolean includeTestSources()
198 {
199 return testSourceIncluded;
200 }
201
202
203
204
205 public ArtifactResolver artifactResolver()
206 {
207 return artifactResolver;
208 }
209
210
211
212
213 public ArtifactMetadataSource artifactMetadataSource()
214 {
215 return artifactMetadataSource;
216 }
217
218
219
220
221 public ArchiverManager archiverManager()
222 {
223 return archiverManager;
224 }
225
226
227
228
229 public ArtifactFactory artifactFactory()
230 {
231 return artifactFactory;
232 }
233
234
235
236
237 public Log log()
238 {
239 return log;
240 }
241
242 }