Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-3775

Regression: SonarException when a project does not contain any file in its source folders

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.2
    • Fix Version/s: 3.2.1, 3.3
    • Component/s: None
    • Labels:
    • Environment:
      Linux

      Description

      After an upgrade from 3.0 to 3.2, our Ant build target started failing with the error attached. Clearly it is unhappy about our empty source directory; but in the past we didn't get this error. The directory does exist.

      In our particular setup, one of our applications has multiple modules (this one has 30 modules), and each module is considered in Sonar to be a separate project. A few of the modules have empty Java source directories because they contain only non-Java files, but our build script is standard across the modules. This wasn't causing problems for us until this upgrade.

      We have worked around the issue by using the "unless" argument on our Ant target that calls the sonar:sonar target, and then setting the linked property in a custom build file in only the modules without source files. In other words, Ant no longer invokes sonar for modules with a manually-set "sonar.notneeded" property. But this means it will have to be maintained in the future, or a better workaround could be made that looks to see if the folder is empty.

      We would like Sonar to be fixed to the old behavior of ignoring empty source folders, or perhaps outputting a warning but not failing entirely.

      Output from Ant is attached.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              fabemn OLD - Fabrice Bellingard
              Reporter:
              richardc Richard Carter
              Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: