apache / apache/maven

[MNG-8725] Option for "-T" argument: Use max cores minus 1

Open
#10,124 2 comments 0 reactions 0 assignees View on GitHub
enhancement priority:major
Dominant language
Java
Stars
5.3k
Forks
3.1k
Avg merge
20h 42m
Merged PRs (30d)
297

Description

**[Matthias Bünger](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=JIRAUSER302100)** opened **[MNG-8725](https://issues.apache.org/jira/browse/MNG-8725?redirect=false)** and commented

You can enable parallel builds in Maven using the `-T` argument and pass the number of threads or threads per core (see: https://cwiki.apache.org/confluence/display/MAVEN/Parallel+builds+in+Maven+3 ).

The Maven Daemon uses the maxinum number of cores minus 1 per default for max effiencey without blocking the system.

Sadly there is no option for the Maven core to behave like this. So each developer has either to have the same number of cores available (which is often not the case) or pass his/her individual number of threads on each call.

It would be great to have a built-in argument to use maximum -1 cores like the Daemon does.

Note: I write cores all the time, because threads in this context are hardware threads (and no virtual threads possible with Java 21 and I don't want to mix this even that Maven is not yet on Java 21)

---

**Affects:** 3.9.9

Contributor guide

Open the contributing guide

Research direction

Start by tracing Maven core's handling of the -T parallel-build argument and compare it with the Maven Daemon's max-cores-minus-one default. Define the built-in option's behavior for hardware threads and verify that parallel builds use the requested default without requiring a per-call thread count.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.