I was getting the following message when changing just a single file in a project and could not find anyone with a similar situation where the jar is needed for implementation:
“Full recompilation is required because /Users/dhensche/Projects/maui-gradle/libs/hibernate3.jar could not be analyzed for incremental compilation. See the debug log for more details. Analysis took 0.406 secs”
Even after moving this jar (I know we need to update ) to a different directory (I put it under “naughty-libs” instead of “libs”, I get the exact same message. It doesn’t even reference the new location. This is after I’ve run a clean and wiped out the .gradle directory. Any assistance would be awesome. We are using the groovy and war plugins and I have followed the steps on the groovy plugin documentation to enable incremental compilation. I also have a custom instrumentation task for enabling some hibernate bytecode enhancements, but I still get this message with these customizations completely commented out
When I ran with --debug, there was no new information around the message. It said the exact same thing with no more information about why it was preventing incremental compilation (and that is ignoring the fact that the jar isn’t even in the mentioned directory anymore). Unless there is a different debug mode I should run, I’m kind of out of ideas. I can run it again and upload some of the log, but I was not able to pull anything useful from it
After running with --debug I’m not seeing the specific log lines you pointed to in the github codebase. Here is a snippet of the output
2025-05-08T13:56:02.949-0500 [INFO] [org.gradle.api.internal.tasks.compile.incremental.SelectiveCompiler] Full recompilation is required because /Users/dhensche/Projects/maui-gradle/libs/hibernate3.jar could not be analyzed for incremental compilation. See the debug log for more details. Analysis took 0.818 secs.
2025-05-08T13:56:03.010-0500 [DEBUG] [org.gradle.internal.execution.history.OutputsCleaner] Deleting stale output file '/Users/dhensche/Projects/maui-gradle/build/classes/groovy/main/uiowa/maui/batch/registrar/ClearingHouseFixEnrlStatDates.class'.
2025-05-08T13:56:03.013-0500 [DEBUG] [org.gradle.internal.execution.history.OutputsCleaner] Deleting stale output file '/Users/dhensche/Projects/maui-gradle/build/classes/groovy/main/uiowa/maui/biz/master/ExternalSyncControl.class'.
2025-05-08T13:56:03.014-0500 [DEBUG] [org.gradle.internal.execution.history.OutputsCleaner] Deleting stale output file '/Users/dhensche/Projects/maui-gradle/build/classes/groovy/main/uiowa/maui/biz/billing/transaction/TransactionDTO.class'.
2025-05-08T13:56:03.017-0500 [DEBUG] [org.gradle.internal.execution.history.OutputsCleaner] Deleting stale output file '/Users/dhensche/Projects/maui-gradle/build/classes/groovy/main/uiowa/maui/site/instructors/InstructorClassListEmailAction.class'.
2025-05-08T13:56:03.018-0500 [DEBUG] [org.gradle.internal.execution.history.OutputsCleaner] Deleting stale output file '/Users/dhensche/Projects/maui-gradle/build/classes/groovy/main/uiowa/maui/api/dto/master/PersonEmailDTOTEMP.class'.
2025-05-08T13:56:03.019-0500 [DEBUG] [org.gradle.internal.execution.history.OutputsCleaner] Deleting stale output file '/Users/dhensche/Projects/maui-gradle/build/classes/groovy/main/uiowa/maui/biz/billing/cashier/CashierTransactionTypeLookup$TransactionTypeLookupFinder.class'.
As you can see there is no stacktrace that appears should be logged from the code you shared. We are using the gradle wrapper and here is the output of --version
------------------------------------------------------------
Gradle 8.12
------------------------------------------------------------
Build time: 2024-12-20 15:46:53 UTC
Revision: a3cacb207fec727859be9354c1937da2e59004c1
Kotlin: 2.0.21
Groovy: 3.0.22
Ant: Apache Ant(TM) version 1.10.15 compiled on August 25 2024
Launcher JVM: 1.8.0_333 (Oracle Corporation 25.333-b02)
Daemon JVM: /Library/Java/JavaVirtualMachines/jdk1.8.0_333.jdk/Contents/Home (no JDK specified, using current Java home)
OS: Mac OS X 15.4.1 x86_64
Can you share the full build log?
Or try scrolling up.
The debug log should be above that line.
It is logged when the analysis problem happened.
This info log line is done later.
Search for debug lines like “Could not analyze … for incremental compilation”.
There the stacktrace should be logged.
I’m not sure if I can upload the entire log file (not sure if there is any sensitive information in it), but I have grepped for all the debug lines you mentioned and couldn’t find anything matching that statement. Even just searching for analyze gives just one output:
grep analyze ../maui-gradle/debug-gradle-2.log
2025-05-08T13:56:02.949-0500 [INFO] [org.gradle.api.internal.tasks.compile.incremental.SelectiveCompiler] Full recompilation is required because /Users/dhensche/Projects/maui-gradle/libs/hibernate3.jar could not be analyzed for incremental compilation. See the debug log for more details. Analysis took 0.818 secs.
We are using the groovy plugin and it looked like the support for incremental compilation was still experimental so I wonder if that has something to do with it. Thank you for looking into this and taking the time, I’ve been scratching my head on this for a while now
Well, I don’t see where else the message could come from.
Set a breakpoint at org.gradle.api.internal.tasks.compile.incremental.recomp.RecompilationSpec#setFullRebuildCause and then run through the debugger to see where the message is coming from and what might be the cause.
I figured it out. That jar hibernate3.jar is a cruddy old fat jar with like 10 different libraries included in it in a non-analyzable way. I’m trying to modernize this project so I am going to move forward (this would usually be the second part of the modernization pattern we’ve been taking) with just replacing it with proper dependencies since that seems to have solved the incremental compilation issue. I have another question, but can start a new thread for it