eltsovalex commented on code in PR #24: URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r972089001
########## src/main/java/org/apache/maven/buildcache/CacheControllerImpl.java: ########## @@ -153,37 +154,50 @@ public CacheControllerImpl( @Override @Nonnull public CacheResult findCachedBuild( MavenSession session, MavenProject project, - List<MojoExecution> mojoExecutions ) + List<MojoExecution> mojoExecutions, boolean skipLookup ) { final String highestRequestPhase = CacheUtils.getLast( mojoExecutions ).getLifecyclePhase(); if ( !lifecyclePhasesHelper.isLaterPhaseThanClean( highestRequestPhase ) ) { return empty(); } - LOGGER.info( "Attempting to restore project from build cache" ); + String projectName = getVersionlessProjectKey( project ); ProjectsInputInfo inputInfo = projectInputCalculator.calculateInput( project ); final CacheContext context = new CacheContext( project, inputInfo, session ); - // remote build first - CacheResult result = findCachedBuild( mojoExecutions, context ); - if ( !result.isSuccess() && result.getContext() != null ) + CacheResult result = empty( context ); + if ( !skipLookup ) { - LOGGER.debug( "Remote cache is incomplete or missing, trying local build" ); - CacheResult localBuild = findLocalBuild( mojoExecutions, context ); + LOGGER.info( "Attempting to restore project {} from build cache", projectName ); - if ( localBuild.isSuccess() || ( localBuild.isPartialSuccess() && !result.isPartialSuccess() ) ) - { - result = localBuild; - } - else + // remote build first Review Comment: This is not my comment - just part of code by @gnodet that I've moved inside a block -- 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: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org