GeezerVison is showing github.com — [core] Support sharing incremental analysis cache file across different machines · Issue #2063 · pmd/pmd
[core] Support sharing incremental analysis cache file across different machines #2063
Description
Affects PMD Version:
6.18
Rule:
N/A
Description:
I am trying to run Incremental analysis with the short-names option turned on from the PMD CLI. I would expect the cache file to contain the relative paths to the files analyzed since short-names was enabled however It appears to be using the full file path instead. Is this the intended functionality?
Previously the cache file had the relative path with the shortnames option on but after #1923 was fixed it appears to only use the full path.
Running PMD through: [CLI | Ant | Maven | Gradle | Designer | Other]
CLI
Reacted by Simon Gamma, Róbert Papp and emouty
Activity
adangel commented on Oct 14, 2019
This works as expected, I'd say. The contents of the cache file should be opaque to the user and it might even change - as it did with the fix for #1923.
We store there the full file path, so that we can match the violations to the correct files. If we only use short names, there might be duplicates (e.g. if PMD is executed to analyze files in two directory, such as -d project1/src,project2/src).
With the fix for #1923, the short names option only has affect now for reporting.
Do you experience any problems with incremental analysis and short names?
mriddell95 commented on Oct 16, 2019
I did find an additional issue here #2062 after #1923 was implemented.
I was hoping to use the shortnames in the cache file to run the PMD cache file on different machines without having to completely re-scan the project again. Since the cache file uses the absolute file path now it is unfortunately not possible to do this.
Would it be possible in the example you gave above ( -d project1/src, project2/src) to prepend the project1 to the beginning of the shortened file path in the cache file? This would hopefully allow the usecase I gave above to be possible
Reacted by Linus Fernandes
adangel commented on Oct 16, 2019
changed the title
[-][core] Incremental analysis cache file contains full file path even with shortnames turned on[/-] [+][core] Support sharing incremental analysis cache file across different machines[/+] on Oct 16, 2019emouty commented on Feb 12, 2025
Metadata
Metadata
Development
No branches or pull requestsIssue actions