As a user, when scanning Java files in an Ant build, I would like console output for the path in the “current file” path to be like the path listed on the SonarQube server (relative path to the project). What I see in the terminal window is “X/X files analyzed, current file: -current working directory-/-path to file-” which is an absolute path.
Having the console output be an absolute path rather than a relative path to the project is misleading. The reason why is that sonar exclusion and inclusion files need to be relative paths to the project, and not absolute paths. With Ant, one could use a fileset or dirset operation with a pathconvert to get the list of files/directories to include/exclude. However, those operations return an absolute path, unless you explicitly use a map with the pathconvert to strip the base directory prefix. Therefore, one could fall into the trap of thinking that files are being included/excluded properly because the file path matches the console output on the screen, but the file will not be included/excluded because sonar.exclusions requires the file paths to be absolute to the project.