mavilov commented on code in PR #412:
URL: 
https://github.com/apache/maven-build-cache-extension/pull/412#discussion_r2577623903


##########
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:
   @elharo your comment makes total sense: info is perhaps better as this will 
give the user clear overview of what is going on with the cache during the 
build.



-- 
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]

Reply via email to