Uploaded image for project: 'Network Controller'
  1. Network Controller
  2. SDNC-127

Generated sources not placed under target directory breaks tooling apps

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Medium Medium
    • Beijing Release
    • None
    • sdnc-core
    • None
    • SDNC Beijing Sprint 2, SDNC Beijing Sprint 3

      The SDNC has many projectes that generate source code. Each of these projects should follow maven convention, which is to place generated source code under the target/generated-sources directory. By not following convention, tools like Intelij cannot be plug a play. These tools do not have enough AI to just infer which folders are source folders.
      Also this makes .gitignore folders more complicated as these need to be maintained to prevent generated file outside of the target directory from getting added to the git repo.

      Here is a suggested fixes:

      project ccsdk/parent

      ubuntu@develbox:/workspace/onap/parent$ git diff
      diff --git a/odlparent-carbon-sr1/pom.xml b/odlparent-carbon-sr1/pom.xml
      index 0844261..5d71f7e 100755
      — a/odlparent-carbon-sr1/pom.xml
      +++ b/odlparent-carbon-sr1/pom.xml
      @@ -58,8 +58,8 @@
      <bundle.plugin.version>2.5.0</bundle.plugin.version>
      <maven.compile.plugin.version>2.5.1</maven.compile.plugin.version>
      <features.file>features.xml</features.file>

      • <jmxGeneratorPath>src/main/yang-gen-config</jmxGeneratorPath>
      • <salGeneratorPath>src/main/yang-gen-sal</salGeneratorPath>
        + <jmxGeneratorPath>target/generated-sources/yang-gen-config</jmxGeneratorPath>
        + <salGeneratorPath>target/generated-sources/yang-gen-sal</salGeneratorPath>
        <checkstyle.skip>true</checkstyle.skip>

       

      project: ccsdk/sli/core

      outputDirectory File - Specify output directory where the Java files are generated.
      Default value is: ${project.build.directory}/generated-sources/antlr4.
      from
      http://www.antlr.org/api/maven-plugin/latest/antlr4-mojo.html

      diff --git a/sli/common/pom.xml b/sli/common/pom.xml
      index bd9ec69..494ab93 100755
      — a/sli/common/pom.xml
      +++ b/sli/common/pom.xml
      @@ -141,9 +141,6 @@
      <version>${antlr.version}</version>
      <executions>
      <execution>

      • <configuration>
      • <outputDirectory>${project.basedir}/src/main/java/</outputDirectory>
      • </configuration>
        <id>antlr</id>
        <goals>
        <goal>antlr4</goal>

       

      Intelij work around:

      After importing all the maven project,  identify which folders outside of the target directory contain generated source and mark them as generated source.   

            djtimoney Dan Timoney
            jsulliva jsulliva
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: