Allow for a sorted log when --batch-mode is used in a multi module project
- Dominant language
- Java
- Stars
- 3.5k
- Forks
- 250
- Avg merge
- 16h 22m
- Merged PRs (30d)
- 36
Description
Hello!
We use maven-daemon to allow for a much better developer experience when dealing with multi module projects.
We also use parallel builds in our CI/CD pipelines, but this is currently using regular maven `mvn -T ` .
Using parallel builds with regular maven results in an unsorted build logfile, rendering it almost unusable.
We're looking at using maven daemon to allow for a sorted log, but unfortunately using `mvnd clean --batch-mode` also results in an unsorted logfile. Although, it does prepend each logline tags in the form of `[project_id] `.
I located the line that eventually directly prints the tagged logline:
https://github.com/apache/maven-mvnd/blob/9f4b57be26a5a979fc9aebfc20e3c23e087f7648/common/src/main/java/org/mvndaemon/mvnd/common/logging/TerminalOutput.java#L392-L404
Line 401 is what is printed
### My Suggestion
Why not remove the block L394-L401 and just allow for the log to still be buffered per project?
So, just always do `prj.log.add(bm.getMessage());`.
What are your thoughts?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in common/src/main/java/org/mvndaemon/mvnd/common/logging/TerminalOutput.java around lines 392-404 and inspect how batch-mode messages are added to the project log. Reproduce a parallel multi-module build with `mvnd clean --batch-mode` and compare its output with the requested per-project buffering. Done means the batch-mode logfile is sorted while retaining the existing project tags.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100