What JDK? Is your system Locale different than en_US?
You know there's a bug in URLConnection, at least in 1.3.1.
The If-Modified-Since header is constructed with system Locale (as opposed
to being constructed with en_US). If system Locale is not en_US, the HTTP
server does not understand the timestamp required and always returns 200/OK,
therefore your (newer) local SNAPSHOT jar is overwritten.

As I look into the CVS repository, it seems that
org.apache.maven.util.HttpUtils was not patched against this issue.

I cannot easily give a diff, since I'm maintaining my own local altered
source copy, but if you think you're affected by that, here is the code
fragment I used in "public static void getFile(String, File, boolean,
boolean, String, String, String, String)":

//modify the headers
//NB: things like user authentication could go in here too.
if ( useTimestamp && hasTimestamp )
{
    // FV: workaround the bug in JDK 1.3
    // connection.setIfModifiedSince( timestamp );
    java.text.SimpleDateFormat sdformat =
        new java.text.SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss 'GMT'",
java.util.Locale.US);
    sdformat.setTimeZone(java.util.TimeZone.getTimeZone("GMT"));
    connection.setRequestProperty("If-Modified-Since", sdformat.format(new
java.util.Date(timestamp)));
}
// prepare Java 1.1 style credentials
if ( username != null || password != null )

Look for the original comments in HttpUtils as a reference point.

HTH, Florin

----- Original Message -----
From: "Sean Timm" <[EMAIL PROTECTED]>
To: "Maven Developers List" <[EMAIL PROTECTED]>
Sent: Thursday, February 05, 2004 9:28 PM
Subject: RC2 - multiproject build issues?


> Using the latest RC2 bits, when I do a "maven
> multiproject:install-snapshot", it builds project A, but then when it
> builds project B (which has a dependency on project A), it downloads the
> snapshot from the remote repository rather than using the snapshot I
> just built for project A.  Is anyone else seeing this issue? (And, no,
> my system clock is not off)... :)
>
> -- Sean T.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



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

Reply via email to