Skip to content

Commit

Permalink
Skip quarkus:dev for modules with packaging pom
Browse files Browse the repository at this point in the history
  • Loading branch information
aloubyansky committed Nov 22, 2022
1 parent 3baf6cc commit 68a5252
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 3 additions & 2 deletions devtools/maven/src/main/java/io/quarkus/maven/BuildMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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'");
Expand Down
5 changes: 5 additions & 0 deletions devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 68a5252

Please sign in to comment.