[ https://issues.apache.org/jira/browse/MBUILDCACHE-105?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17877405#comment-17877405 ]
ASF GitHub Bot commented on MBUILDCACHE-105: -------------------------------------------- reda-alaoui commented on code in PR #176: URL: https://github.com/apache/maven-build-cache-extension/pull/176#discussion_r1734733542 ########## 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: @AlexanderAshitkin I agree with you. At first I wanted to fix the extension to make it able to save cache state on phase < package. But there is this sentence in the [documentation](https://maven.apache.org/extensions/maven-build-cache-extension/usage.html): > Once the extension is activated, the cache automatically kicks in on every package or higher phase. I could not find the reason of this constraint, so I made sure this fix respects the latter. Also the fix should be quick to merge to prevent people from getting into trouble. I also think this extension should not limit itself to phases >= `package`. We can still come back to that later. > 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)