[
https://issues.apache.org/jira/browse/MBUILDCACHE-78?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17847243#comment-17847243
]
Johan Parent commented on MBUILDCACHE-78:
-----------------------------------------
Hello [~honnix] ,
I tried on your cache project. Thing seems to work, no? The checksums match
and files get restored. Or is their content wrong?
Regards,
Johan
{code:java}
INFO] --------------------------< io.honnix:cache >---------------------------
[INFO] Building cache 1.0-SNAPSHOT [1/3]
[INFO] from pom.xml
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] ----------------------------< io.honnix:a >-----------------------------
[INFO] Building a 1.0-SNAPSHOT [2/3]
[INFO] from a/pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] Going to calculate checksum for project [groupId=io.honnix, artifactId=a]
[INFO] Scanning plugins configurations to find input files. Probing is enabled,
values will be checked for presence in file system
[INFO] Found 1 input files. Project dir processing: 6, plugins: 4 millis
[INFO] Project inputs calculated in 25 ms. SHA-256 checksum
[585351936dd02c1a4d84a3384e83fa66698e678148b14c141a3fb8855e32df6c] calculated
in 24 ms.
[INFO] Attempting to restore project io.honnix:a from build cache
[INFO] Local build found by checksum
585351936dd02c1a4d84a3384e83fa66698e678148b14c141a3fb8855e32df6c
[INFO] Found cached build, restoring io.honnix:a from cache by checksum
585351936dd02c1a4d84a3384e83fa66698e678148b14c141a3fb8855e32df6c
[INFO] Skipping plugin execution (cached): resources:resources
[INFO] Skipping plugin execution (cached): compiler:compile
[INFO] Skipping plugin execution (cached): resources:testResources
[INFO] Skipping plugin execution (cached): compiler:testCompile
[INFO] Skipping plugin execution (cached): surefire:test
[INFO]
[INFO] ----------------------------< io.honnix:b >-----------------------------
[INFO] Building b 1.0-SNAPSHOT [3/3]
[INFO] from b/pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] Going to calculate checksum for project [groupId=io.honnix, artifactId=b]
[INFO] Scanning plugins configurations to find input files. Probing is enabled,
values will be checked for presence in file system
[INFO] Found 1 input files. Project dir processing: 2, plugins: 1 millis
[INFO] Going to calculate checksum for project [groupId=io.honnix, artifactId=a]
[INFO] Project inputs calculated in 6 ms. SHA-256 checksum
[4fded1cb646674a216944e06b31754cb5a90c70ea90b8c1acc18f56fd11a6a7b] calculated
in 2 ms.
[INFO] Attempting to restore project io.honnix:b from build cache
[INFO] Local build found by checksum
4fded1cb646674a216944e06b31754cb5a90c70ea90b8c1acc18f56fd11a6a7b
[INFO] Found cached build, restoring io.honnix:b from cache by checksum
4fded1cb646674a216944e06b31754cb5a90c70ea90b8c1acc18f56fd11a6a7b
[INFO] Skipping plugin execution (cached): resources:resources
[INFO] Skipping plugin execution (cached): compiler:compile
[INFO] Skipping plugin execution (cached): resources:testResources
[INFO] Skipping plugin execution (cached): compiler:testCompile
[INFO] Skipping plugin execution (cached): surefire:test
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for cache 1.0-SNAPSHOT:
[INFO]
[INFO] cache .............................................. SUCCESS [ 0.005 s]
[INFO] a .................................................. SUCCESS [ 0.279 s]
[INFO] b .................................................. SUCCESS [ 0.019 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.390 s
[INFO] Finished at: 2024-05-17T13:14:50+02:00
[INFO]
------------------------------------------------------------------------{code}
> Maven reactor doesn't work well for a multimodule project when enabling build
> cache
> -----------------------------------------------------------------------------------
>
> Key: MBUILDCACHE-78
> URL: https://issues.apache.org/jira/browse/MBUILDCACHE-78
> Project: Maven Build Cache Extension
> Issue Type: Bug
> Affects Versions: 1.1.0
> Environment: macOS Sonama, Java 17, Maven 3.9.6
> Reporter: Hongxin Liang
> Priority: Critical
>
> In a multimodule project, as a simplest example:
> [https://github.com/honnix/cache|https://github.com/honnix/cache] , "mvn
> compile" with build cache enabled doesn't play well with Maven reactor. A few
> scenarios I have tested in the provided repro example:
> # With a clean environment (no build cache, no "mvn install" have been done)
> ## Run "mvn compile" and everything works
> ## Modify (putting a random empty line will suffice) class "B" in module "b"
> ## Run "mvn compile" again, and now it fails when trying to download
> snapshot of module "a" from maven central (after failing to find that in my
> local repo)
> # With a clean environment (no build cache)
> ## Run "mvn install" and everything works
> ## Modify class "A" in module "a" to rename the method
> ## Run "mvn compile" for the first time, and it fails to compile due to
> renaming of the method in class "A"
> ## Run "mvn compile" for the second time, nothing fails but apparent the
> code is still wrong; run more "mvn compile" and still nothing fails
> ## Running "mvn install" fails the build due to compilation error
> I'm not entirely sure I am doing things properly and I'm not sure whether the
> config is correct either (I took the example as
> [https://maven.apache.org/extensions/maven-build-cache-extension/maven-build-cache-config.xml]
> with modification to disable remote cache).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)