From 68a5252f83c135cac1c9af48432fe7a9684b9f9e Mon Sep 17 00:00:00 2001 From: Alexey Loubyansky Date: Tue, 22 Nov 2022 21:51:04 +0100 Subject: [PATCH] Skip quarkus:dev for modules with packaging pom --- devtools/maven/src/main/java/io/quarkus/maven/BuildMojo.java | 5 +++-- devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/devtools/maven/src/main/java/io/quarkus/maven/BuildMojo.java b/devtools/maven/src/main/java/io/quarkus/maven/BuildMojo.java index 2c28d222736f7..0efc3d5f20a7c 100644 --- a/devtools/maven/src/main/java/io/quarkus/maven/BuildMojo.java +++ b/devtools/maven/src/main/java/io/quarkus/maven/BuildMojo.java @@ -29,6 +29,7 @@ import io.quarkus.bootstrap.app.AugmentResult; import io.quarkus.bootstrap.app.CuratedApplication; import io.quarkus.bootstrap.util.IoUtils; +import io.quarkus.maven.dependency.ArtifactCoords; /** * Builds the Quarkus application. @@ -77,11 +78,11 @@ protected boolean beforeExecute() throws MojoExecutionException { getLog().info("Skipping Quarkus build"); return false; } - if (mavenProject().getPackaging().equals("pom")) { + if (mavenProject().getPackaging().equals(ArtifactCoords.TYPE_POM)) { getLog().info("Type of the artifact is POM, skipping build goal"); return false; } - if (!mavenProject().getArtifact().getArtifactHandler().getExtension().equals("jar")) { + if (!mavenProject().getArtifact().getArtifactHandler().getExtension().equals(ArtifactCoords.TYPE_JAR)) { throw new MojoExecutionException( "The project artifact's extension is '" + mavenProject().getArtifact().getArtifactHandler().getExtension() + "' while this goal expects it be 'jar'"); diff --git a/devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java b/devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java index ac5bc0683a3e1..aa3ef463c7f52 100644 --- a/devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java +++ b/devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java @@ -391,6 +391,11 @@ public void setLog(Log log) { @Override public void execute() throws MojoFailureException, MojoExecutionException { + if (project.getPackaging().equals(ArtifactCoords.TYPE_POM)) { + getLog().info("Type of the artifact is POM, skipping dev goal"); + return; + } + mavenVersionEnforcer.ensureMavenVersion(getLog(), session); initToolchain();