You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Michael Young <ja...@onyourside.net> on 2002/11/06 00:13:26 UTC

A timestamp problem when building jar/war files in ANT

Hi everybody,

I am having a very strange problem, and I haven't seen it on the
ant mail archives, so I thought I'd post it here to see if I can
get some pointers from you gurus.

I'm running Ant 1.4.1/JDK1.3.1_05 on W2K.  I also tried the new
Ant 1.5 but got the same problem.

Ok, here's my problem.  I have a bunch of files in a directory,
and these files all have PST timestamp (e.g. 11/05/2002 3:20PM).
But in the jar/war file built by ANT, all of the files have a
timestamp that's 8 hours ahead.  If I use jar command directly,
then I don't have this problem.  Only when using Ant.  It looks
like my local time is being converted to GMT, but it's not 
converted back.  The timezone on my W2K is set to PST (America/LA).

This is causing a big headache for me, because all my JSP pages
are 8 hours ahead, so as a result, for the first 8 hours, my app
server has to recompile all these JSP pages each time they are
accessed.

Seems like a bug in ANT.

Has anyone seen this before?

Thanks!  /Michael.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: A timestamp problem when building jar/war files in ANT

Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 6 Nov 2002, Michael Young <ja...@onyourside.net> wrote:

> Basically we call org.apache.ant.Main directly and passing to it a
> java.home property via "-Djava.home=%JAVA_HOME%".  For some reasons,
> this causes Ant to look for %JAVA_HOME%/lib/tzmappings which does
> not exist because it's in %JAVA_HOME%/jre/lib.

Here is the clue for you - for some reason Sun's JVMs >= 1.2 (and
probably all others derived from Sun's code= set the system property
java.home to %JAVA_HOME%/jre, at least for the definition of JAVA_HOME
that Ant expects.

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: A timestamp problem when building jar/war files in ANT

Posted by Michael Young <ja...@onyourside.net>.
I found out what's going on, although I don't know why it behaves in such a
way.

Basically we call org.apache.ant.Main directly and passing to it a java.home
property via "-Djava.home=%JAVA_HOME%".  For some reasons, this causes Ant
to look for %JAVA_HOME%/lib/tzmappings which does not exist because it's in
%JAVA_HOME%/jre/lib.  As a result, the jar task uses GMT time to jarring all
the files.

Once I remove "-Djava.home=...", everything is OK.

/Michael.

----- Original Message -----
From: "Michael Young" <ja...@onyourside.net>
To: <an...@jakarta.apache.org>
Sent: Tuesday, November 05, 2002 3:13 PM
Subject: A timestamp problem when building jar/war files in ANT


> Hi everybody,
>
> I am having a very strange problem, and I haven't seen it on the
> ant mail archives, so I thought I'd post it here to see if I can
> get some pointers from you gurus.
>
> I'm running Ant 1.4.1/JDK1.3.1_05 on W2K.  I also tried the new
> Ant 1.5 but got the same problem.
>
> Ok, here's my problem.  I have a bunch of files in a directory,
> and these files all have PST timestamp (e.g. 11/05/2002 3:20PM).
> But in the jar/war file built by ANT, all of the files have a
> timestamp that's 8 hours ahead.  If I use jar command directly,
> then I don't have this problem.  Only when using Ant.  It looks
> like my local time is being converted to GMT, but it's not
> converted back.  The timezone on my W2K is set to PST (America/LA).
>
> This is causing a big headache for me, because all my JSP pages
> are 8 hours ahead, so as a result, for the first 8 hours, my app
> server has to recompile all these JSP pages each time they are
> accessed.
>
> Seems like a bug in ANT.
>
> Has anyone seen this before?
>
> Thanks!  /Michael.
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: A timestamp problem when building jar/war files in ANT

Posted by Lee Gwun Wai <gw...@pacific.net.sg>.
I haven't tried this out, but perhaps you can use the Touch task to touch
the file to a different timestamp?

-----Original Message-----
From: Michael Young [mailto:javaone@onyourside.net]
Sent: Wednesday, November 06, 2002 7:13 AM
To: ant-user@jakarta.apache.org
Subject: A timestamp problem when building jar/war files in ANT


Hi everybody,

I am having a very strange problem, and I haven't seen it on the
ant mail archives, so I thought I'd post it here to see if I can
get some pointers from you gurus.

I'm running Ant 1.4.1/JDK1.3.1_05 on W2K.  I also tried the new
Ant 1.5 but got the same problem.

Ok, here's my problem.  I have a bunch of files in a directory,
and these files all have PST timestamp (e.g. 11/05/2002 3:20PM).
But in the jar/war file built by ANT, all of the files have a
timestamp that's 8 hours ahead.  If I use jar command directly,
then I don't have this problem.  Only when using Ant.  It looks
like my local time is being converted to GMT, but it's not
converted back.  The timezone on my W2K is set to PST (America/LA).

This is causing a big headache for me, because all my JSP pages
are 8 hours ahead, so as a result, for the first 8 hours, my app
server has to recompile all these JSP pages each time they are
accessed.

Seems like a bug in ANT.

Has anyone seen this before?

Thanks!  /Michael.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>