diff --git a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/ImageBuild.java b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/ImageBuild.java index a4a3c58d4f1ca..e233b15d53e5c 100644 --- a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/ImageBuild.java +++ b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/ImageBuild.java @@ -6,6 +6,7 @@ import javax.inject.Inject; import org.gradle.api.provider.MapProperty; +import org.gradle.api.tasks.TaskAction; import org.gradle.api.tasks.options.Option; public abstract class ImageBuild extends ImageTask { @@ -20,8 +21,14 @@ public void setBuilder(Builder builder) { @Inject public ImageBuild() { super("Perform an image build"); + } + + @TaskAction + @Override + public void checkRequiredExtensions() { MapProperty forcedProperties = extension().forcedPropertiesProperty(); forcedProperties.put(QUARKUS_CONTAINER_IMAGE_BUILD, "true"); forcedProperties.put(QUARKUS_CONTAINER_IMAGE_BUILDER, getProject().provider(() -> builder().name())); + super.checkRequiredExtensions(); } } diff --git a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/ImagePush.java b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/ImagePush.java index 4fa72ecee5a1c..9b2237ed7c749 100644 --- a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/ImagePush.java +++ b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/ImagePush.java @@ -15,13 +15,13 @@ public abstract class ImagePush extends ImageTask { @Inject public ImagePush() { super("Perform an image push"); - MapProperty forcedProperties = extension().forcedPropertiesProperty(); - forcedProperties.put(QUARKUS_CONTAINER_IMAGE_BUILD, "true"); - forcedProperties.put(QUARKUS_CONTAINER_IMAGE_PUSH, "true"); } @TaskAction public void checkRequiredExtensions() { + MapProperty forcedProperties = extension().forcedPropertiesProperty(); + forcedProperties.put(QUARKUS_CONTAINER_IMAGE_BUILD, "true"); + forcedProperties.put(QUARKUS_CONTAINER_IMAGE_PUSH, "true"); List containerImageExtensions = getProject().getConfigurations().stream() .flatMap(c -> c.getDependencies().stream()) .map(d -> d.getName())