Added default output directory to CodeGeneratorImpl in maven-sal-api-gen-plugin.
[controller.git] / opendaylight / sal / yang-prototype / code-generator / maven-yang-plugin / src / main / java / org / opendaylight / controller / yang2sources / plugin / YangToSourcesProcessor.java
index a7b7f429ccbffbd9bf4f4593094989446914105f..b781d72311e19a8a9372ce49c64fa9e254ef9827 100644 (file)
@@ -144,11 +144,11 @@ class YangToSourcesProcessor {
                 throw new MojoFailureException(message, e);
             }
 
-            setResource(targetYangDir, META_INF_YANG_DIR.getPath(), project);
+            setResource(targetYangDir, META_INF_YANG_STRING_JAR, project);
 
             log.debug(Util.message(
                     "Yang files from: %s marked as resources: %s", LOG_PREFIX,
-                    yangFilesRootDir, META_INF_YANG_DIR.getPath()));
+                    yangFilesRootDir, META_INF_YANG_STRING_JAR));
         }
 
         private static void setResource(File targetYangDir, String targetPath,
@@ -220,7 +220,9 @@ class YangToSourcesProcessor {
                 codeGeneratorCfg.getCodeGeneratorClass(),
                 codeGeneratorCfg.getAdditionalConfiguration()));
 
-        project.addCompileSourceRoot(outputDir.getAbsolutePath());
+        if(outputDir != null) {
+            project.addCompileSourceRoot(outputDir.getAbsolutePath());
+        }
         g.setLog(log);
         g.setMavenProject(project);
         g.setAdditionalConfig(codeGeneratorCfg.getAdditionalConfiguration());