Skip to content

Commit f227320

Browse files
committed
add slide on parallel builds
1 parent 92e07eb commit f227320

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

slides/lab-7.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,33 @@ Separate CI-specific settings from the default developer experience:
533533

534534
---
535535

536+
## Tip 7: Build Multi-Module Projects in Parallel
537+
538+
Maven can build **independent modules concurrently** with the `-T` flag:
539+
540+
```bash
541+
# 4 threads — good starting point for most multi-module projects
542+
./mvnw verify -T 4
543+
544+
# Scale to available CPU cores (1 thread per core)
545+
./mvnw verify -T 1C
546+
547+
# Combine with CI profile
548+
./mvnw verify -T 1C -P ci
549+
```
550+
551+
---
552+
553+
554+
Maven resolves the module dependency graph and builds modules that don't depend on each other **at the same time**.
555+
556+
**Caveats:**
557+
- Modules with inter-dependencies are still built sequentially
558+
- Plugin output interleaves - use `-T 1C` with `redirectTestOutputToFile`
559+
- Use the `mvnd` daemon for improved console output
560+
561+
---
562+
536563
# GitHub Actions Best Practices
537564

538565
---

0 commit comments

Comments
 (0)