- yangProvider.addYangsToMetaInf(log, project, yangFilesRootDir, excludedFiles);
+ yangProvider.addYangsToMetaInf(project, yangFilesRootDir, excludedFiles);
+ }
+ }
+
+ void conditionalExecute(final boolean skip) throws MojoExecutionException, MojoFailureException {
+ if (skip) {
+ LOG.info("Skipping YANG code generation because property yang.skip is true");
+
+ // But manually add resources
+ // add META_INF/yang
+ yangProvider.addYangsToMetaInf(project, yangFilesRootDir, excludedFiles);
+
+ // add META_INF/services
+ File generatedServicesDir = new File(project.getBasedir(), CodeGeneratorArg.YANG_SERVICES_GENERATED_DIR);
+ YangProvider.setResource(generatedServicesDir, project);
+ LOG.debug("{} Yang services files from: {} marked as resources: {}", LOG_PREFIX, generatedServicesDir,
+ META_INF_YANG_SERVICES_STRING_JAR);
+
+
+ } else {
+ execute();