|
82 | 82 | import org.apache.maven.model.Resource;
|
83 | 83 | import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
|
84 | 84 | import org.apache.maven.project.MavenProject;
|
85 |
| -import org.codehaus.plexus.util.IOUtil; |
86 | 85 | import org.codehaus.plexus.util.WriterFactory;
|
87 | 86 | import org.eclipse.aether.RepositorySystem;
|
88 | 87 | import org.eclipse.aether.artifact.DefaultArtifactType;
|
@@ -344,19 +343,13 @@ private boolean checkItemMatchesBaseline(ProjectsInputInfo baselineBuild, Digest
|
344 | 343 | private String getEffectivePom(Model prototype) throws IOException {
|
345 | 344 | ByteArrayOutputStream output = new ByteArrayOutputStream();
|
346 | 345 |
|
347 |
| - Writer writer = null; |
348 |
| - try { |
349 |
| - writer = WriterFactory.newXmlWriter(output); |
| 346 | + try (Writer writer = WriterFactory.newXmlWriter(output)) { |
350 | 347 | new MavenXpp3Writer().write(writer, prototype);
|
351 | 348 |
|
352 | 349 | // normalize env specifics
|
353 | 350 | final String[] searchList = {baseDirPath.toString(), "\\", "windows", "linux"};
|
354 | 351 | final String[] replacementList = {"", "/", "os.classifier", "os.classifier"};
|
355 |
| - |
356 | 352 | return replaceEachRepeatedly(output.toString(), searchList, replacementList);
|
357 |
| - |
358 |
| - } finally { |
359 |
| - IOUtil.close(writer); |
360 | 353 | }
|
361 | 354 | }
|
362 | 355 |
|
@@ -520,7 +513,7 @@ public FileVisitResult preVisitDirectory(Path path, BasicFileAttributes basicFil
|
520 | 513 | return FileVisitResult.SKIP_SUBTREE;
|
521 | 514 | }
|
522 | 515 |
|
523 |
| - walkDirectoryFiles(path, collectedFiles, key.getGlob(), entry -> exclusionResolver.excludesPath(entry)); |
| 516 | + walkDirectoryFiles(path, collectedFiles, key.getGlob(), exclusionResolver::excludesPath); |
524 | 517 |
|
525 | 518 | if (!key.isRecursive()) {
|
526 | 519 | LOGGER.debug("Skipping subtree (non recursive): {}", path);
|
|
0 commit comments