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 | |
public class SourceResolverConfig |
35 | |
{ |
36 | |
|
37 | |
private final MavenProject project; |
38 | |
|
39 | |
private ArtifactFilter filter; |
40 | |
|
41 | |
private List<MavenProject> reactorProjects; |
42 | |
|
43 | |
private final File outputBasedir; |
44 | |
|
45 | |
private boolean compileSourceIncluded; |
46 | |
|
47 | |
private boolean testSourceIncluded; |
48 | |
|
49 | |
private final ArtifactRepository localRepository; |
50 | |
|
51 | |
private final ArtifactResolver artifactResolver; |
52 | |
|
53 | |
private final ArtifactMetadataSource artifactMetadataSource; |
54 | |
|
55 | |
private final ArchiverManager archiverManager; |
56 | |
|
57 | |
private final ArtifactFactory artifactFactory; |
58 | |
|
59 | |
private final Log log; |
60 | |
|
61 | |
public SourceResolverConfig( final Log log, final MavenProject project, final ArtifactRepository localRepository, |
62 | |
final File outputBasedir, final ArtifactResolver artifactResolver, |
63 | |
final ArtifactFactory artifactFactory, |
64 | |
final ArtifactMetadataSource artifactMetadataSource, |
65 | |
final ArchiverManager archiverManager ) |
66 | 0 | { |
67 | 0 | this.log = log; |
68 | 0 | this.project = project; |
69 | 0 | this.localRepository = localRepository; |
70 | 0 | this.outputBasedir = outputBasedir; |
71 | 0 | this.artifactResolver = artifactResolver; |
72 | 0 | this.artifactFactory = artifactFactory; |
73 | 0 | this.artifactMetadataSource = artifactMetadataSource; |
74 | 0 | this.archiverManager = archiverManager; |
75 | 0 | } |
76 | |
|
77 | |
public SourceResolverConfig withFilter( final ArtifactFilter filter ) |
78 | |
{ |
79 | 0 | this.filter = filter; |
80 | 0 | return this; |
81 | |
} |
82 | |
|
83 | |
public SourceResolverConfig withReactorProjects( final List<MavenProject> reactorProjects ) |
84 | |
{ |
85 | 0 | this.reactorProjects = reactorProjects; |
86 | 0 | return this; |
87 | |
} |
88 | |
|
89 | |
public SourceResolverConfig withCompileSources() |
90 | |
{ |
91 | 0 | compileSourceIncluded = true; |
92 | 0 | return this; |
93 | |
} |
94 | |
|
95 | |
public SourceResolverConfig withoutCompileSources() |
96 | |
{ |
97 | 0 | compileSourceIncluded = false; |
98 | 0 | return this; |
99 | |
} |
100 | |
|
101 | |
public SourceResolverConfig withTestSources() |
102 | |
{ |
103 | 0 | testSourceIncluded = true; |
104 | 0 | return this; |
105 | |
} |
106 | |
|
107 | |
public SourceResolverConfig withoutTestSources() |
108 | |
{ |
109 | 0 | testSourceIncluded = false; |
110 | 0 | return this; |
111 | |
} |
112 | |
|
113 | |
public MavenProject project() |
114 | |
{ |
115 | 0 | return project; |
116 | |
} |
117 | |
|
118 | |
public ArtifactRepository localRepository() |
119 | |
{ |
120 | 0 | return localRepository; |
121 | |
} |
122 | |
|
123 | |
public ArtifactFilter filter() |
124 | |
{ |
125 | 0 | return filter; |
126 | |
} |
127 | |
|
128 | |
public List<MavenProject> reactorProjects() |
129 | |
{ |
130 | 0 | return reactorProjects; |
131 | |
} |
132 | |
|
133 | |
public File outputBasedir() |
134 | |
{ |
135 | 0 | return outputBasedir; |
136 | |
} |
137 | |
|
138 | |
public boolean includeCompileSources() |
139 | |
{ |
140 | 0 | return compileSourceIncluded; |
141 | |
} |
142 | |
|
143 | |
public boolean includeTestSources() |
144 | |
{ |
145 | 0 | return testSourceIncluded; |
146 | |
} |
147 | |
|
148 | |
public ArtifactResolver artifactResolver() |
149 | |
{ |
150 | 0 | return artifactResolver; |
151 | |
} |
152 | |
|
153 | |
public ArtifactMetadataSource artifactMetadataSource() |
154 | |
{ |
155 | 0 | return artifactMetadataSource; |
156 | |
} |
157 | |
|
158 | |
public ArchiverManager archiverManager() |
159 | |
{ |
160 | 0 | return archiverManager; |
161 | |
} |
162 | |
|
163 | |
public ArtifactFactory artifactFactory() |
164 | |
{ |
165 | 0 | return artifactFactory; |
166 | |
} |
167 | |
|
168 | |
public Log log() |
169 | |
{ |
170 | 0 | return log; |
171 | |
} |
172 | |
|
173 | |
} |