sparsick commented on code in PR #412:
URL:
https://github.com/apache/maven-build-cache-extension/pull/412#discussion_r2578641492
##########
src/main/java/org/apache/maven/buildcache/BuildCacheMojosExecutionStrategy.java:
##########
@@ -178,13 +182,30 @@ public void execute(
}
/**
- * Cache configuration could demand to restore some files in the project
directory (generated sources or even arbitrary content)
- * If an error occurs during or after this kind of restoration AND a clean
phase was required in the build :
- * we execute an extra clean phase to remove any potential partially
restored files
+ * Check if the current mojo execution is for the clean goal
+ *
+ * @param mojoExecutions the mojo executions
+ * @return true if the goal is clean and it is the only goal, false
otherwise
+ */
+ private boolean isGoalClean(List<MojoExecution> mojoExecutions) {
+ if (mojoExecutions.stream().allMatch(mojoExecution ->
"clean".equals(mojoExecution.getLifecyclePhase()))) {
+ LOGGER.warn("Build cache is disabled for 'clean' goal.");
Review Comment:
I will also prefer info instead of debug if warn is not okay.. IMHO, the
user has to be informed that we skip the cache mechanism here because of the
clean goal.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]