File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Ant, Maven and Other Build Tools and the fly likes Ant: List source files and date last modifed? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Ant: List source files and date last modifed?" Watch "Ant: List source files and date last modifed?" New topic

Ant: List source files and date last modifed?

Jillian Kay

Joined: Apr 02, 2004
Posts: 5
Hi, I've been asked to find a tool/script/way to do this, and haven't had much luck so far.

Final goal is to be able to compare two versions of a jar/ear/war and tell which *source* files changed between versions, and when those changes happened. The idea I was asked to explore would be to list all of the source files and the date each was last modified (not the build date). Original thought is to list these in the manifest, though another included file would be acceptable. I expect we'll build a script that would extract and compare the lists.

This way we could look at a huge jar and say "oh, this jar is using the December 11, 2008 version of, while this other jar that is breaking is using the March 15, 2009 version of - that was around the time we made such and such design decision" And then know where to debug.

This sounds like something that would be useful enough to have been done before....but I can't seem to find any code or tools that do it. Maybe I'm just not using the right terminology to search? Any ideas?

Thanks in advance!

Lost, as always.
Martijn Verburg

Joined: Jun 24, 2003
Posts: 3275

Hi there,

Do you actually include the source files as part of your deployments? Typically it's only .class files that get included.

Do you have source control? Typically it's _much_ easier to do these comparisons from source control, e.g. You tag the source control whenever you do a release and you can then do a diff between those..

Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
I agree. Here's the link:
subject: Ant: List source files and date last modifed?
It's not a secret anymore!