You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by ss...@gmail.com on 2009/12/01 06:58:23 UTC

maven downloading SNAPSHOTs which have not changed

I have been noticing that Maven is redownloading some SNAPSHOTs every day,  
despite the fact that the files have not changed. I ran my build using "mvn  
-X clean package" and I can see that an HTTP 304 is being returned  
(verified on the server), yet the file is downloaded anyway. Is there some  
sort of a setting which would force snapshots to be redownloaded even if  
the server is reporting a 304?

Maven version:

$> mvn --version
Apache Maven 2.2.0 (r788681; 2009-06-26 22:04:01+0900)
Java version: 1.6.0_16
Java home: /usr/lib/jvm/java-6-sun-1.6.0.16/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.28-14-generic" arch: "amd64" Family: "unix"



Output:

...
[DEBUG] Connecting to repository: 'company-repository' with  
url: 'http://maven/maven/maven2'.
Downloading:  
http://maven/maven/maven2/com/company/sp/reports/1.0-SNAPSHOT/reports-1.0-SNAPSHOT.jar
[DEBUG] sending ==> If-Modified-Since: Mon, 30-Nov-09 01:08:30 GMT
(1259543310000)
2824/4410K^M2828/4410K^M2832/4410K^M2836/4410K^M2839/4410K^M2840/4410K^M2842/4410K^M2843/4410K^M[DEBUG]  
http://maven/maven/maven2/com/company/sp/reports/1.0-SNAPSHOT/reports-1.0-SNAPSHOT.jar  
-  
Status code: 304
[DEBUG] Artifact resolved
2844/4410K
...



Testing the httpd server for 304 support:

$> telnet maven 80
Trying 172.25.16.21...
Connected to maven.company.com.
Escape character is '^]'.
GET  
/maven/maven2/com/company/sp/reports/1.0-SNAPSHOT/reports-1.0-SNAPSHOT.jar  
HTTP/1.0
User-Agent: Mozilla/5.0
From: something.somewhere.net
Accept: text/html,text/plain,application/*
Host: maven.company.com
If-Modified-Since: Mon, 30-Nov-09 01:08:30 GMT

HTTP/1.1 304 Not Modified
Date: Tue, 01 Dec 2009 05:30:00 GMT
Server: Apache/2.0.53 (Unix) DAV/2 mod_ssl/2.0.53 OpenSSL/0.9.7g SVN/1.4.5
Connection: close
ETag: "234f4-40bfa6-9f0a32c0"