Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overwrite lastModified on the folder after compiling #72

Open
MartinKanters opened this issue Mar 26, 2020 · 2 comments
Open

Overwrite lastModified on the folder after compiling #72

MartinKanters opened this issue Mar 26, 2020 · 2 comments

Comments

@MartinKanters
Copy link

MartinKanters commented Mar 26, 2020

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.

@gnodet
Copy link
Member

gnodet commented Feb 8, 2022

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.

@gnodet
Copy link
Member

gnodet commented Oct 27, 2023

MNG-4660 has been closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants