Uploaded image for project: 'Maven Wagon'
  1. Maven Wagon
  2. WAGON-126

The getIfNewer method fails to work if file doesn't exist locally and the Last-Modified header isn't sent by the server

    XMLWordPrintableJSON

    Details

      Description

      The code doesn't work correctly if the following two conditions are met simultaneously:

      the local file doesn't exist — hence the timestamp parameter is 0
      (ii) the remote server doesn't send the "Last-Modified" header.

      Since the lastModified variable is initialized to 0 in line 355, if the above two conditions are met,
      the following if statement at line 371 evaluates to false:

      • if ( timestamp < lastModified )
        {
        retValue = true;

      and therefore the file won't be downloaded, causing the dependency to fail.

      This used to work with Maven 1.0.2.

      To fix this problem, initialize the lastModified variable to 1.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                brettporter Brett Porter
                Reporter:
                kohsuke Kohsuke Kawaguchi
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: