@@ -124,22 +124,8 @@ private Map<Path, Xml.Document> createResult(Path basePath, List<Resource> pomFi
124
124
return parsedPoms .stream ()
125
125
.map (pom -> mapResourceToDocument (basePath , pom , pomFiles ))
126
126
.collect (Collectors .toMap (e -> ResourceUtil .getPath (e .getKey ()), e -> e .getValue ()));
127
-
128
-
129
-
130
- // return pomFiles.stream()
131
- // .map(pom -> mapResourceToDocument(basePath, pom, parsedPoms))
132
- // .sorted(this::sortMap)
133
- // .collect(Collectors.toMap(l -> l.getKey(), l -> l.getValue()));
134
127
}
135
128
136
- private int sortMap (Map .Entry <Resource , Xml .Document > e1 , Map .Entry <Resource , Xml .Document > e2 ) {
137
- Path path1 = ResourceUtil .getPath (e1 .getKey ());
138
- Path path2 = ResourceUtil .getPath (e2 .getKey ());
139
- return path1 .compareTo (path2 );
140
- }
141
-
142
-
143
129
private Map .Entry <Resource , Xml .Document > mapResourceToDocument (Path basePath , SourceFile pom , List <Resource > parsedPoms ) {
144
130
Xml .Document doc = (Xml .Document ) pom ;
145
131
Resource resource = parsedPoms .stream ()
@@ -149,17 +135,6 @@ private Map.Entry<Resource, Xml.Document> mapResourceToDocument(Path basePath, S
149
135
return Map .entry (resource , doc );
150
136
}
151
137
152
- private static Map .Entry <Resource , Xml .Document > mapResourceToDocument (Path basePath , Resource pom , List <SourceFile > parsedPoms ) {
153
- Xml .Document sourceFile = parsedPoms
154
- .stream ()
155
- .filter (p -> basePath .resolve (p .getSourcePath ()).normalize ().toString ().equals (ResourceUtil .getPath (pom ).toString ()))
156
- .filter (Xml .Document .class ::isInstance )
157
- .map (Xml .Document .class ::cast )
158
- .findFirst ()
159
- .get ();
160
- return Map .entry (pom , sourceFile );
161
- }
162
-
163
138
private List <SourceFile > parsePoms (Path baseDir , List <Resource > pomFiles , MavenParser .Builder mavenParserBuilder , ExecutionContext executionContext ) {
164
139
Iterable <Parser .Input > pomFileInputs = pomFiles .stream ()
165
140
.map (p -> new Parser .Input (ResourceUtil .getPath (p ), () -> ResourceUtil .getInputStream (p )))
@@ -209,15 +184,6 @@ private void initializeMavenSettings(ExecutionContext executionContext) {
209
184
210
185
}
211
186
212
- private List <Resource > collectUpstreamPomFiles (List <Resource > pomFiles ) {
213
- // pomFiles.stream()
214
- // .map(mavenModelReader::readModel)
215
- // .map(Model::)
216
- // return pomFiles;
217
- // FIXME: implement
218
- return null ;
219
- }
220
-
221
187
public List <Resource > filterAndSortBuildFiles (List <Resource > resources ) {
222
188
return resources .stream ()
223
189
.filter (r -> "pom.xml" .equals (ResourceUtil .getPath (r ).toFile ().getName ()))
0 commit comments