apache / apache/maven-build-cache-extension
[MBUILDCACHE-78] Maven reactor doesn't work well for a multimodule project when enabling build cache
- Dominant language
- Java
- Stars
- 163
- Forks
- 77
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 4
Description
**[Hongxin Liang](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=honnix)** opened **[MBUILDCACHE-78](https://issues.apache.org/jira/browse/MBUILDCACHE-78?redirect=false)** and commented
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:
1. With a clean environment (no build cache, no "mvn install" have been done)
1. Run "mvn compile" and everything works
2. Modify (putting a random empty line will suffice) class "B" in module "b"
3. 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)
2. With a clean environment (no build cache)
1. Run "mvn install" and everything works
2. Modify class "A" in module "a" to rename the method
3. Run "mvn compile" for the first time, and it fails to compile due to renaming of the method in class "A"
4. Run "mvn compile" for the second time, nothing fails but apparent the code is still wrong; run more "mvn compile" and still nothing fails
5. 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).
---
**Affects:** 1.1.0
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the linked multimodule repro and the Maven build-cache configuration, then run the reported mvn compile and mvn install sequences while modifying classes A and B. Trace reactor and cache behavior around the snapshot lookup and incremental compilation; done means the scenarios compile against the current reactor state and detect the renamed method without requiring an installed artifact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100