[ 
https://issues.apache.org/jira/browse/MBUILDCACHE-105?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17877018#comment-17877018
 ] 

ASF GitHub Bot commented on MBUILDCACHE-105:
--------------------------------------------

AlexanderAshitkin commented on code in PR #176:
URL: 
https://github.com/apache/maven-build-cache-extension/pull/176#discussion_r1732039886


##########
src/main/java/org/apache/maven/buildcache/CacheControllerImpl.java:
##########
@@ -255,6 +255,11 @@ private CacheResult analyzeResult(CacheContext context, 
List<MojoExecution> mojo
                         build.getCacheImplementationVersion());
             }
 
+            if (lifecyclePhasesHelper.isLaterPhaseThanBuild("package", build)) 
{
+                LOGGER.warn("Cached build doesn't include phase 'package', 
cannot restore");

Review Comment:
   In the current implementation, the 'analyzeResult' returns partial success 
in lines 277-278 as expected.
   
   More accurate implementation could support pre-compile phases - 'save' and 
restore generated sources and continue with compile. This will allow restoring 
missing sources from the cache and potentially saving time on the code 
generation. Could be handy in  IDEs which could compile the project if 
generated sources are restored. 
   
   The second concern is that we still process builds that will never be used 
in the 'save'. Save and restore should be consistent, and the situation when 
cached builds are not usable should also be considered for improvement.
   
   Though overall, as a quick fix, this change seems legitimate, it feels like 
restoring generated sources and commencing with compilation would be more 
optimal.





> Executing 'clean process-test-classes'  then 'clean verify' leads to empty 
> jars
> -------------------------------------------------------------------------------
>
>                 Key: MBUILDCACHE-105
>                 URL: https://issues.apache.org/jira/browse/MBUILDCACHE-105
>             Project: Maven Build Cache Extension
>          Issue Type: Bug
>            Reporter: Réda Housni Alaoui
>            Priority: Major
>              Labels: pull-request-available
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to