diff --git a/README.adoc b/README.adoc index 3c1d8ca10..d09db1347 100644 --- a/README.adoc +++ b/README.adoc @@ -26,8 +26,9 @@ This architecture brings the following advantages: `mvnd` brings the following features on top of the stock Maven: -* `-T1C` is used by default. This means builing in parallel using as many threads as CPU cores on your machine. If your - source tree does not support parallel builds, pass `-T1` on the command line to make your build serial. +* By default, `mvnd` is building your modules in parallel using multiple CPU cores. The number of utilized cores is + given by the formula `Math.max(Runtime.getRuntime().availableProcessors() - 1, 1)`. If your source tree does not + support parallel builds, pass `-T1` on the command line to make your build serial. * Improved console output: we believe that the output of a parallel build on a stock Maven is hard to follow. Therefore, we implemented a simplified a non-rolling view showing the status of each build thread on a separate line. This is what it looks like on a machine with 24 cores: diff --git a/client/src/main/java/org/jboss/fuse/mvnd/client/DefaultClient.java b/client/src/main/java/org/jboss/fuse/mvnd/client/DefaultClient.java index 36fad9829..94cf2b7f6 100644 --- a/client/src/main/java/org/jboss/fuse/mvnd/client/DefaultClient.java +++ b/client/src/main/java/org/jboss/fuse/mvnd/client/DefaultClient.java @@ -234,7 +234,7 @@ public ExecutionResult execute(ClientOutput output, List argv) { static void setDefaultArgs(List args) { if (args.stream().noneMatch(arg -> arg.startsWith("-T") || arg.equals("--threads"))) { - int procs = Runtime.getRuntime().availableProcessors() - 1; + final int procs = Math.max(Runtime.getRuntime().availableProcessors() - 1, 1); args.add("-T" + procs); } if (args.stream().noneMatch(arg -> arg.startsWith("-b") || arg.equals("--builder"))) {