Overwrite lastModified on the folder after compiling
For implementing Maven issue MNG-4660 we would like to be able to know when the last compilation happened. We need this information to determine the packaged artifact (.jar) is up-to-date with the compiled sources (in target/classes usually). For now we will look through all target/classes files to check their lastModified time, but if we could use the lastModified time on the target/classes directory, we could improve performance a lot.
On Unix based systems, the target/classes directory will (if I remember correctly) be updated to the time of compilation, but for Windows it isn't. https://stackoverflow.com/questions/12249155/how-to-get-the-last-modified-date-and-time-of-a-directory-in-java
So my suggestion is to overwrite the lastModified property on the target/classes directory after compilation.
On unix, the last modified date is modified only when the structure of the directory is changed, according to https://stackoverflow.com/questions/3451863/when-does-a-unix-directory-change-its-timestamp
So an explicit change would have to be done on both systems.
MNG-4660 has been closed.