Uploaded image for project: 'Maven Shared Components'
  1. Maven Shared Components
  2. MSHARED-884

Only overwrite filtered resources when contents differ

    XMLWordPrintableJSON

    Details

      Description

      When filtering files with the MavenFileFilter.copyFile method, the destination file should only be overwritten if the contents have changed. Currently we unconditionally overwrite the contents in this situation, potentially leading to unnecessary downstream work. When the overwrite parameter is true then overwriting should overwrite as it does now.

      Given a copyFile call
      When an identical copyFile operation is performed
      Then the destination file should remain unmodified

      Given a copyFile call with overwrite set true
      When an identical copyFile operation is performed
      Then the destination file should be overwritten

      The linked pull request meets these requirements by writing the filtered resource to a temporary file and then comparing the temporary contents to the content of a previously written target file. If the contents match then the temporary file is deleted, otherwise it's renamed over the top of the target file.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                olamy Olivier Lamy
                Reporter:
                roxspring Robert James Oxspring
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: