diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/AddMavenWrapperChecksumValidation.java b/rewrite-maven/src/main/java/org/openrewrite/maven/AddMavenWrapperChecksumValidation.java index 05eb3bb4afe..d6c16200718 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/AddMavenWrapperChecksumValidation.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/AddMavenWrapperChecksumValidation.java @@ -164,34 +164,34 @@ private File downloadWrapperAndMarkToDelete(String wrapperUrl) throws IOExceptio } private File downloadMavenArtifact(final ResolvedGroupArtifactVersion rgav, String type) throws IOException { - final MavenArtifactCache cache = new LocalMavenArtifactCache(Files.createTempDirectory("repository")); - //final MavenSettings settings = new MavenSettings(); - final MavenArtifactDownloader downloader = new MavenArtifactDownloader(cache, null, Throwable::printStackTrace); - final ResolvedDependency rd = new ResolvedDependency( - MavenRepository.MAVEN_CENTRAL, - rgav, - new Dependency( - null, - null, - type, - null, - Collections.emptyList(), - null - ), - Collections.emptyList(), - Collections.emptyList(), - null, - null, - false, - 1, - Collections.emptyList() - - ); - - return Optional - .ofNullable(downloader.downloadArtifact(rd)) - .map(Path::toFile) - .orElseThrow(() -> new RuntimeException("Could not download artifact " + rd.toString())); + final MavenArtifactCache cache = new LocalMavenArtifactCache(Files.createTempDirectory("repository")); + //final MavenSettings settings = new MavenSettings(); + final MavenArtifactDownloader downloader = new MavenArtifactDownloader(cache, null, Throwable::printStackTrace); + final ResolvedDependency rd = new ResolvedDependency( + MavenRepository.MAVEN_CENTRAL, + rgav, + new Dependency( + null, + null, + type, + null, + Collections.emptyList(), + null + ), + Collections.emptyList(), + Collections.emptyList(), + null, + null, + false, + 1, + Collections.emptyList() + + ); + + return Optional + .ofNullable(downloader.downloadArtifact(rd)) + .map(Path::toFile) + .orElseThrow(() -> new RuntimeException("Could not download artifact " + rd.toString())); } private Properties addPropertyToProperties(Properties mavenWrapperProperties, String name, String value) {