The following comment has been added to this issue:

     Author: Vincent Massol
    Created: Wed, 3 Sep 2003 2:42 AM
       Body:
I've also had several reports like this on my current project. I haven't been able yet 
to tell whether the problem was due to:

- a bad machine date (either local machine or remote repo machine)
- a web server not supporting if-modified-since
- a bug

I have looked at the source code and couldn't find any reason why it wouldn't work as 
expected (in HttpUtils, from CVS HEAD):

[...]
        boolean hasTimestamp = false;
        if ( useTimestamp && destinationFile.exists() )
        {
            timestamp = destinationFile.lastModified();
            hasTimestamp = true;
        }
[...]
        if ( useTimestamp && hasTimestamp )
        {
            connection.setIfModifiedSince( timestamp );
        }
[...]
            if ( httpConnection.getResponseCode() == 
HttpURLConnection.HTTP_NOT_MODIFIED )
            {
                return;
            }

-Vincent
---------------------------------------------------------------------
View the issue:

  http://jira.codehaus.org/secure/ViewIssue.jspa?key=MAVEN-772


Here is an overview of the issue:
---------------------------------------------------------------------
        Key: MAVEN-772
    Summary: SNAPSHOT download overwrites more recent local file
       Type: Bug

     Status: Unassigned
   Priority: Critical

 Time Spent: Unknown
  Remaining: 30 minutes

    Project: maven
 Components: 
             release
   Versions:
             1.0-beta-10
             maven-new-unreleased
             1.0-final
             1.0-rc1
             1.1

   Assignee: 
   Reporter: Martin Skopp

    Created: Wed, 3 Sep 2003 2:10 AM
    Updated: Wed, 3 Sep 2003 2:10 AM
Environment: linux, jdk 1.4.2 / jdk 1.4.0

Description:
I have the problem that I have created fresh and most-recent new snaphot
jars in my _local_ repository (lets say in project A).

Now I like to test them inside Project B with depends upon this
snapshots jar!

Problem: In online mode, maven downloads the snapshots jars from it's
remove repository and overwrites the fresh most-recent jars which I just
installed into my local repo.

As a workaround, of course I can run in offline mode, but this has other
drawbacks (e.g. if meanwhile project B needs to download a new jar).

Is there any option inside maven to prevent such a behaviour in online
mode?? IMHO maven should replace the snapshot jar only if the remote
version is _really_ younger than the one on my local harddrive!

You help and comments highly appreciated - I *really* need this...
I am sorry but I was unable to provide a patch - have no idea where to check the maven 
sources.  If one helps me a little and tells me which classes do the download, I am 
looking into the source myself.
Thanks in advance,
Martin


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to