@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() {
}
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) {
}
}
+ void conditionalExecute(boolean skip) throws MojoExecutionException, MojoFailureException {
+ if (skip) {
+ LOG.info("Skipping YANG code generation because property yang.skip is true");
+ } else {
+ execute();
+ }
+ }
+
private ContextHolder processYang() throws MojoExecutionException {
final CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
SchemaContext resolveSchemaContext;