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

Easy API to access from a sensor to the "sonar.projectBaseDir" value of the root module

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Plugin API, Scanner
    • Labels:
      None

      Description

      There is currently no easy way in the API to access to the "sonar.projectBaseDir" property value from a sensor. The FileSystem::baseDir() method returns the baseDir of the current module. Whereas when you're in a multi-modules project, it should be possible at any point of time to retrieve a file/report based on this project root directory.

      Workaround: inject ProjectReactor in your Sensor constructor. Then use ProjectReactor::getRoot()::getBaseDir()

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              freddy.mallet Freddy Mallet (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: