1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.repository;
20
21 import java.util.List;
22 import java.util.Map;
23 import java.util.Set;
24
25 import org.apache.maven.artifact.Artifact;
26 import org.apache.maven.artifact.repository.ArtifactRepository;
27
28
29
30
31
32
33
34 public class MetadataResolutionRequest {
35 private MavenArtifactMetadata mad;
36
37 private String scope;
38
39
40 private Set<Artifact> artifactDependencies;
41
42 private ArtifactRepository localRepository;
43
44 private List<ArtifactRepository> remoteRepositories;
45
46
47 private Map managedVersionMap;
48
49
50 private boolean asList = true;
51
52
53 private boolean asDirtyTree = false;
54
55
56 private boolean asResolvedTree = false;
57
58
59 private boolean asGraph = false;
60
61 public MetadataResolutionRequest() {}
62
63 public MetadataResolutionRequest(
64 MavenArtifactMetadata md, ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories) {
65 this.mad = md;
66 this.localRepository = localRepository;
67 this.remoteRepositories = remoteRepositories;
68 }
69
70 public MavenArtifactMetadata getArtifactMetadata() {
71 return mad;
72 }
73
74 public MetadataResolutionRequest setArtifactMetadata(MavenArtifactMetadata md) {
75 this.mad = md;
76
77 return this;
78 }
79
80 public MetadataResolutionRequest setArtifactDependencies(Set<Artifact> artifactDependencies) {
81 this.artifactDependencies = artifactDependencies;
82
83 return this;
84 }
85
86 public Set<Artifact> getArtifactDependencies() {
87 return artifactDependencies;
88 }
89
90 public ArtifactRepository getLocalRepository() {
91 return localRepository;
92 }
93
94 public MetadataResolutionRequest setLocalRepository(ArtifactRepository localRepository) {
95 this.localRepository = localRepository;
96
97 return this;
98 }
99
100
101
102
103 @Deprecated
104 public List<ArtifactRepository> getRemoteRepostories() {
105 return remoteRepositories;
106 }
107
108 public List<ArtifactRepository> getRemoteRepositories() {
109 return getRemoteRepostories();
110 }
111
112
113
114
115 @Deprecated
116 public MetadataResolutionRequest setRemoteRepostories(List<ArtifactRepository> remoteRepostories) {
117 this.remoteRepositories = remoteRepostories;
118
119 return this;
120 }
121
122 public MetadataResolutionRequest setRemoteRepositories(List<ArtifactRepository> remoteRepositories) {
123 return setRemoteRepostories(remoteRepositories);
124 }
125
126 public Map getManagedVersionMap() {
127 return managedVersionMap;
128 }
129
130 public MetadataResolutionRequest setManagedVersionMap(Map managedVersionMap) {
131 this.managedVersionMap = managedVersionMap;
132
133 return this;
134 }
135
136 public String toString() {
137 StringBuilder sb = new StringBuilder()
138 .append("REQUEST: ")
139 .append("\n")
140 .append("artifact: ")
141 .append(mad)
142 .append("\n")
143 .append(artifactDependencies)
144 .append("\n")
145 .append("localRepository: ")
146 .append(localRepository)
147 .append("\n")
148 .append("remoteRepositories: ")
149 .append(remoteRepositories)
150 .append("\n");
151
152 return sb.toString();
153 }
154
155 public boolean isAsList() {
156 return asList;
157 }
158
159 public MetadataResolutionRequest setAsList(boolean asList) {
160 this.asList = asList;
161 return this;
162 }
163
164 public boolean isAsDirtyTree() {
165 return asDirtyTree;
166 }
167
168 public MetadataResolutionRequest setAsDirtyTree(boolean asDirtyTree) {
169 this.asDirtyTree = asDirtyTree;
170 return this;
171 }
172
173 public boolean isAsResolvedTree() {
174 return asResolvedTree;
175 }
176
177 public MetadataResolutionRequest setAsResolvedTree(boolean asResolvedTree) {
178 this.asResolvedTree = asResolvedTree;
179 return this;
180 }
181
182 public boolean isAsGraph() {
183 return asGraph;
184 }
185
186 public MetadataResolutionRequest setAsGraph(boolean asGraph) {
187 this.asGraph = asGraph;
188 return this;
189 }
190
191 public MetadataResolutionRequest setScope(String scope) {
192 this.scope = scope;
193 return this;
194 }
195
196 public String getScope() {
197 return scope;
198 }
199 }