diff --git a/src/main/java/org/openrewrite/java/micronaut/MicronautVersionHelper.java b/src/main/java/org/openrewrite/java/micronaut/MicronautVersionHelper.java index a5e39be..6050965 100644 --- a/src/main/java/org/openrewrite/java/micronaut/MicronautVersionHelper.java +++ b/src/main/java/org/openrewrite/java/micronaut/MicronautVersionHelper.java @@ -17,6 +17,7 @@ import org.openrewrite.ExecutionContext; import org.openrewrite.gradle.DependencyVersionSelector; +import org.openrewrite.gradle.marker.GradleBuildscript; import org.openrewrite.gradle.marker.GradlePluginDescriptor; import org.openrewrite.gradle.marker.GradleSettings; import org.openrewrite.maven.MavenDownloadingException; @@ -69,7 +70,12 @@ public static Optional getNewerVersion(String versionPattern, String cur public static Optional getNewerGradlePluginVersion(String pluginId, String versionPattern, String currentVersion, ExecutionContext ctx) throws MavenDownloadingException { MavenRepository gradlePluginsRepo = new MavenRepository("gradle-plugins", "https://plugins.gradle.org/m2/", "true", "false", true, null, null, true); - GradleSettings gradleSettings = new GradleSettings(randomId(), singletonList(gradlePluginsRepo), singletonList(new GradlePluginDescriptor("io.micronaut.gradle.MicronautApplicationPlugin", null)), emptyMap()); + GradleSettings gradleSettings = new GradleSettings( + randomId(), + singletonList(gradlePluginsRepo), + singletonList(new GradlePluginDescriptor("io.micronaut.gradle.MicronautApplicationPlugin", null)), + emptyMap(), + new GradleBuildscript(randomId(), singletonList(gradlePluginsRepo), emptyMap())); return Optional.ofNullable(new DependencyVersionSelector(null, null, gradleSettings) .select(new GroupArtifactVersion(pluginId, pluginId + ".gradle.plugin", currentVersion), "classpath", versionPattern, null, ctx)); }