Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8313069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:22:28+00:00 2026-06-08T20:22:28+00:00

I have a project that I have been working on for a few days

  • 0

I have a project that I have been working on for a few days and I finally got it to compile cleanly. However, a git clone of the same remote branch (on the same machine, compiled in the same terminal instance) caused a compilation error. A fresh clone on a different machine had the same error. I figured it was an issue with my working directory having some additional untracked files, but I deleted all untracked files to the point where diff says the directories are identical except for things contained in the .git folder. I even checked permissions with tree and compared the resulting files with meld – they were basically identical, although a few source files had slightly different execution permissions.

The error was one that came from a file which I had excluded in the maven-compiler-plugin. This should essentially mean that the filename is never passed to javac, although I don’t know exactly how it works under the hood. I realize that clearly the compiler is getting the file from somewhere if it is erroring on code inside it. In the one directory on my computer which worked, there are no errors and it compiles perfectly. On the other clones of the repo (which are, again, identical according to diff) it gives an error on this (excluded) file.

Additional experimentation showed that on a fresh git clone of the remote branch, a cp -R of the local directory, or a git clone of the local directory, compile failed. However, if I did a cp with the --archive option, the compile in the resulting directory succeeded. I narrowed it down to the --preserve=timestamps flag (which is enabled due to the fact that --archive is the same as -dR --preserve=all). If you didn’t quite catch that, I’ll say it again.

When I copy the directory normally, it refuses to compile properly. Only when the timestamps are preserved does it behave identically to the original directory.

I don’t understand this – why does the java compiler (or maven) care about the timestamps?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T20:22:30+00:00Added an answer on June 8, 2026 at 8:22 pm

    The problem ended up being a Maven compiler plugin issue combined with the fact that I was trying to do something which was somewhat misguided.

    Briefly, the compiler plugin passes in a list of every file you want to compile as well as a link to the source directory.

    The list of files is perfectly fine, as this is how javac knows which things to compile. However, the fact that the source directory is also being passed is not ideal. When you put a file (or pattern) into the maven compiler plugin’s <excludes> tag, it will no longer show up in the list of files passed to javac. However, it will most likely reside in your source directory (which maven passes to javac). This means that javac can still compile these files if it wants to, even though you excluded them. This may occur if one of the files is a dependency of another. The expected behavior here would be to throw an error – instead, it compiles the excluded file and continues on its merry way.

    In my situation (as I explained in the comments) I was having issues because a file which was explicitly excluded (reason: an unrelated bug in the way maven handles classpaths means that file cannot be compiled properly by maven) was still trying to be compiled, even though I was trying to provide a pre-compiled version of the class.

    In this case, if I copied the files without timestamps being preserved it thought the source files had been modified recently, and that the precompiled version of the class was out of date. Therefore javac tried to compile the excluded file. Only when I preserved the timestamps (which showed that the file had not been modified in months) did javac realize it should use the provided .class file instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a project on github that I have been working on before. However,
I have been working on a project for a few days now and have
I have been working on this project for a few days, it’s a C#
I have a django project that I have been working on as a solo
I have a console project that I have been working on. I added log4net
Hey so I have been working on a project that I want to be
Afternoon, I have been working with CKEditor and CKFinder for the last few days
Say I have been working on a project for a while, added a few
I'm currently working on a C++ project that needs to have as few external
I have been working on a side project for the last few weeks, and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.