Add property "yang.skip"
[yangtools.git] / yang / yang-maven-plugin / src / main / java / org / opendaylight / yangtools / yang2sources / plugin / YangToSourcesMojo.java
index 0d3f970e1ea3f82be48dfdf7ef88988d71eb145c..a6752b167b85423304bc4eac8176e27daaa27b09 100644 (file)
@@ -86,6 +86,9 @@ public final class YangToSourcesMojo extends AbstractMojo {
     @Parameter( readonly = true, defaultValue = "${project.remoteArtifactRepositories}" )
     private List<ArtifactRepository> remoteRepos;
 
+    // When set to "true", then the execution of the plugin is disabled
+    @Parameter( property = "yang.skip" )
+    private String yang_skip;
 
     public YangToSourcesMojo() {
     }
@@ -113,7 +116,7 @@ public final class YangToSourcesMojo extends AbstractMojo {
             yangToSourcesProcessor = new YangToSourcesProcessor(buildContext, yangFilesRootFile,
                     excludedFiles, codeGeneratorArgs, project, inspectDependencies);
         }
-        yangToSourcesProcessor.execute();
+        yangToSourcesProcessor.conditionalExecute("true".equals(yang_skip));
     }
 
     private static List<CodeGeneratorArg> processCodeGenerators(final CodeGeneratorArg[] codeGenerators) {