I fixed the wagon bug yesterday (so this only affects the maven 1.1 betas, and should be ok in the final release).

We'll need to investigate this. It's probably wise to make the proxy action HTTP aware and grab the response to modify. I think another alternative is to add the last modified header to xwork.xml and have it use an expression (which should work with the code you have here).



On 25/08/2006, at 8:28 PM, Nicolas De Loof wrote:


I don't find support for Last-Modified header in webwork StreamResult. I never used webwork before, so I don't knwo where to search...

I'd like to add this to ProxyAction :

private Date lastModified;

public String execute()
       throws ProxyException
   {
      ...
       lastModified = new Date(file.lastModified());
      ...
   }

It seems the default Date.toString() is acceptable for Last- Modified header.

Nico.

Nicolas De Loof a écrit :

I was wrong in this diagnostic.

Sounds like a Wagon bug : When artifact doesn't exists, maven ask for last-modified = 0 Archiva response has no last-modified header, so wagon uses lastModified=0

The response content is extracted from HTTP response only if (timestamp < lastModified).

-> This is a Wagon HTTP provider bug. It should consider long lastModified = Long.MAX_VALUE; as default

-> To be compatible with existing maven, Archiva should send a Last-Modified header. No idea what value to send. Idealy, the last- modified date of the artifact in the proxied repo would be the best.


Nicolas De Loof a écrit :

Maven1 is sending an "If-Modified-Since" header. Sounds like Archiva doesn't send the file. As it just downloaded it, I supose file in managed repo has lastchanged date to "now". So this sounds like an Archiva bug.

Nicolas De Loof a écrit :

I've setup my archiva as a maven proxy and can get artifacts as expected using legacy path when using a browser.

I've set maven.repo.remote = http://localhost:8080/maven- repository-webapp/proxy/vasn/ Now, when I run maven (1.1-beta-3) to build my project, artifacts are downloaded in my managed repo as expected, but maven1 doesn't put them into my local repo :
I get output in maven console :
"
Tentative de téléchargement des dépandances manquantes/snapshot requis par hamlet:
Tentative de téléchargement de log4j-1.2.13.jar.
Téléchargement passé car la copie locale est à jour!
Tentative de téléchargement de commons-modeler-1.1.jar.
Téléchargement passé car la copie locale est à jour!
...
"

Just to help, here is the HTTP headers I get when using a browser :

"
GET /maven-repository-webapp/proxy/vasn//log4j/jars/ log4j-1.2.13.jar HTTP/1.1
Host: localhost:8580
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; fr; rv: 1.8.0.6) Gecko/20060728 Firefox/1.5.0.6 Accept: text/xml,application/xml,application/xhtml+xml,text/ html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: JSESSIONID=7CB00D6F750F3BB6B228688AD48BC923; jforumUserHash=null; jforumAutoLogin=null; jforumUserId=2

HTTP/1.x 200 OK
Server: Apache-Coyote/1.1
content-disposition: filename="log4j-1.2.13.jar"
Content-Type: application/octet-stream
Transfer-Encoding: chunked
Date: Fri, 25 Aug 2006 08:22:44 GMT
"

Any idea ?

Nico.





This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.


This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.


This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.


This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.

Reply via email to