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

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

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


##########
src/main/java/org/apache/maven/buildcache/DefaultNormalizedModelProvider.java:
##########
@@ -81,7 +82,7 @@ private Model normalizedModelInner(MavenProject project) {
         // does not make sense to add project version to calculate hash
         resultModel.setVersion(NORMALIZED_VERSION);
         resultModel.setModules(prototype.getModules());
-
+        
resultModel.setProperties(normalizeProperties(prototype.getProperties()));

Review Comment:
   Tracking the cache properties by itself doesn't seem helpful because the 
checksum produced using these hints is what matters.
   
   Consider 2 cases:
   1) `maven.build.cache.exclude.glob.1` doesn't exclude anything. Removing 
this property doesn't affect the cache checksum and artifacts - there is no 
point in having different cache records for the change. In this case 
effectively the same build will be stored under two different checksums.
   2) `maven.build.cache.exclude.glob.1` excludes something. In that case, the 
excluded elements will contribute to the checksum, and there will be a new 
cache record. In this case adding the property to the checksum is redundant.
   
   Currently, I can only see a potential regression in the form of a reduced 
cache hit rate in this change. 
   





> pom.xml properties 'maven.build.cache.*' are not part of the effective pom 
> involved by the checksum
> ---------------------------------------------------------------------------------------------------
>
>                 Key: MBUILDCACHE-107
>                 URL: https://issues.apache.org/jira/browse/MBUILDCACHE-107
>             Project: Maven Build Cache Extension
>          Issue Type: Bug
>            Reporter: RĂ©da Housni Alaoui
>            Priority: Major
>              Labels: pull-request-available
>
> Changing a pom.xml property like {{maven.build.cache.exclude.glob.1}} does 
> not impact the input checksum and therefore keeps using the wrong cache 
> entry. The only remediation is to remove the cache entry manually.



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

Reply via email to