From 90efaf466a6ec161b71b73890fe968b2135b37c9 Mon Sep 17 00:00:00 2001 From: Christian Stein Date: Mon, 7 Jan 2019 21:30:35 +0100 Subject: [PATCH] Auto-skip plugin execution on pom projects (#43) Addresses #41 --- src/main/java/com/coveo/AbstractFMT.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/com/coveo/AbstractFMT.java b/src/main/java/com/coveo/AbstractFMT.java index 384c8ba..5d9dbe9 100644 --- a/src/main/java/com/coveo/AbstractFMT.java +++ b/src/main/java/com/coveo/AbstractFMT.java @@ -38,6 +38,12 @@ public abstract class AbstractFMT extends AbstractMojo { ) private File testSourceDirectory; + @Parameter( + defaultValue = "${project.packaging}", + required = true + ) + private String packaging; + @Parameter(property = "additionalSourceDirectories") private File[] additionalSourceDirectories; @@ -72,6 +78,10 @@ public void execute() throws MojoExecutionException, MojoFailureException { getLog().info("Skipping format check"); return; } + if ("pom".equals(packaging)) { + getLog().info("Skipping format check: project uses 'pom' packaging"); + return; + } if (skipSortingImports) { getLog().info("Skipping sorting imports"); }