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