GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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

New issue
Copy link
New issue
Copy link
Open
Open
[core] Support sharing incremental analysis cache file across different machines#2063
Copy link
Labels
an:enhancementAn improvement on existing features / rules

Description

@mriddell95
mriddell95
opened on Oct 10, 2019
Issue body actions

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

  1. adangel commented on Oct 14, 2019

    @adangel
    adangel
    on Oct 14, 2019
    Member
    More actions

    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?

  2. mriddell95 commented on Oct 16, 2019

    @mriddell95
    mriddell95
    on Oct 16, 2019
    Author
    More actions

    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
  3. adangel commented on Oct 16, 2019

    @adangel
    adangel
    on Oct 16, 2019
    Member
    More actions

    Thanks for explaining your use case. Currently we don't support sharing the cache file across different machines, but that sounds like a useful enhancement.

    I'll change the title of this issue accordingly.

    Current documentation about incremental analysis: https://pmd.github.io/latest/pmd_userdocs_incremental_analysis.html

  4. adangel
    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, 2019
  5. adangel
    added
    an:enhancementAn improvement on existing features / rules
    on Oct 16, 2019
  6. emouty commented on Feb 12, 2025

    @emouty
    emouty
    on Feb 12, 2025
    Contributor
    More actions

    This would be interesting to be able to use pmd with maven build cache extension on CI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    an:enhancementAn improvement on existing features / rules

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.