From c674eaa8be96a447b6ce914574dbb90e2c0c53a6 Mon Sep 17 00:00:00 2001 From: Boris Brodski Date: Thu, 28 Jan 2016 18:50:04 +0100 Subject: [PATCH] Add "skip" property to MOJOs This fixes https://github.com/bsorrentino/maven-annotation-plugin/issues/59 --- .../processor/AbstractAnnotationProcessorMojo.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/org/bsc/maven/plugin/processor/AbstractAnnotationProcessorMojo.java b/src/main/java/org/bsc/maven/plugin/processor/AbstractAnnotationProcessorMojo.java index 1342cea..409d9ac 100644 --- a/src/main/java/org/bsc/maven/plugin/processor/AbstractAnnotationProcessorMojo.java +++ b/src/main/java/org/bsc/maven/plugin/processor/AbstractAnnotationProcessorMojo.java @@ -247,6 +247,12 @@ interface ArtifactClosure { @Parameter() private java.util.List processSourceArtifacts = Collections.emptyList(); + /** + * Set this to true to skip annotation processing. + */ + @Parameter(defaultValue = "false", property = "skipAnnotationProcessing") + protected boolean skip; + /** * for execution synchronization */ @@ -337,6 +343,12 @@ private String buildCompileClasspath() */ public void execute() throws MojoExecutionException { + if (skip) + { + getLog().info("skipped"); + return; + } + if ("pom".equalsIgnoreCase(project.getPackaging())) // Issue 17 { return;