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

API returns different paths in case of single-module and multi-module configurations

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.3
    • Fix Version/s: 5.5
    • Component/s: Scanner
    • Labels:
      None
    • Environment:
      SQ 5.3
      SQ Scanner 2.4

      Description

      Project layout:

      $ pwd
      /tmp/ws/prj
      
      $ realpath .
      /Users/evgeny.mandrikov/projects/sonar-tests-languages/it-cpp/plugin/projects/cppcheck-multi_module
      
      $ ls -lA /tmp/ws/
      total 4
      lrwxr-xr-x 1 evgeny.mandrikov wheel 99 Feb  4 18:29 prj -> /Users/evgeny.mandrikov/projects/sonar-tests-languages/it-cpp/plugin/projects/cppcheck-multi_module
      
      $ ls -lAR
      .:
      total 4
      drwxr-xr-x 3 evgeny.mandrikov staff 102 Jul 22  2013 module1
      drwxr-xr-x 3 evgeny.mandrikov staff 102 Jul 22  2013 module2
      -rw-r--r-- 1 evgeny.mandrikov staff 319 Feb  4 18:54 sonar-project.properties
      
      ./module1:
      total 0
      drwxr-xr-x 3 evgeny.mandrikov staff 102 Sep 11  2013 src
      
      ./module1/src:
      total 0
      -rw-r--r-- 1 evgeny.mandrikov staff 0 Jul 22  2013 foo.cpp
      
      ./module2:
      total 0
      drwxr-xr-x 3 evgeny.mandrikov staff 102 Jul 22  2013 src
      
      ./module2/src:
      total 0
      -rw-r--r-- 1 evgeny.mandrikov staff 0 Jul 22  2013 foo.cpp
      

      Sensor does

      System.out.println(fileSystem.files(fileSystem.predicates().all()));
      

      In case of

      sonar-project.properties
      sonar.projectKey=my:project
      sonar.projectName=My project
      sonar.projectVersion=1.0
      
      sonar.sources=module1,module2
      

      output is

      [/Users/evgeny.mandrikov/projects/sonar-tests-languages/it-cpp/plugin/projects/cppcheck-multi_module/module1/src/foo.cpp, /Users/evgeny.mandrikov/projects/sonar-tests-languages/it-cpp/plugin/projects/cppcheck-multi_module/module2/src/foo.cpp]
      

      same if sonar.sources=.

      But in case of

      sonar-project.properties
      sonar.projectKey=my:project
      sonar.projectName=My project
      sonar.projectVersion=1.0
      
      sonar.modules=module1,module2
      module1.sonar.sources=src
      module2.sonar.sources=src
      

      output is

      [/tmp/ws/prj/module1/src/foo.cpp]
      [/tmp/ws/prj/module2/src/foo.cpp]
      

      IMO also will be very valuable to document how API supposed to behave in such and similar cases.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              duarte.meneses Duarte Meneses
              Reporter:
              evgeny.mandrikov Evgeny Mandrikov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: