Correction (sorry), the exception stack trace that I wanted to paste
(again, it's not relevant for the current maven-4.0.x branch builds)

[INFO] Build timeline report generated at
/Users/sergey/dev/miro/server/target/timeline/build-report.html

[ERROR] Step $plan$ not found

java.util.NoSuchElementException: Step $plan$ not found

    at
org.apache.maven.lifecycle.internal.concurrent.BuildPlan.lambda$requiredStep$0(
BuildPlan.java:89)

    at java.util.Optional.orElseThrow(Optional.java:403)

    at
org.apache.maven.lifecycle.internal.concurrent.BuildPlan.requiredStep(
BuildPlan.java:89)

    at
org.apache.maven.lifecycle.internal.concurrent.BuildPlanExecutor$BuildContext.lambda$calculateLifecycleMappings$21(
BuildPlanExecutor.java:1111)

    at java.lang.Iterable.forEach(Iterable.java:75)

    at
org.apache.maven.lifecycle.internal.concurrent.BuildPlanExecutor$BuildContext.lambda$calculateLifecycleMappings$20(
BuildPlanExecutor.java:1107)

    at java.util.LinkedHashMap$LinkedKeySet.forEach(LinkedHashMap.java:730)

    at
org.apache.maven.lifecycle.internal.concurrent.BuildPlanExecutor$BuildContext.calculateLifecycleMappings(
BuildPlanExecutor.java:1107)

    at
org.apache.maven.lifecycle.internal.concurrent.BuildPlanExecutor$BuildContext.calculateLifecycleMappings(
BuildPlanExecutor.java:1018)

    at
org.apache.maven.lifecycle.internal.concurrent.BuildPlanExecutor$BuildContext.calculateMojoExecutions(
BuildPlanExecutor.java:954)

    at
org.apache.maven.lifecycle.internal.concurrent.BuildPlanExecutor$BuildContext.buildInitialPlan(
BuildPlanExecutor.java:250)

    at
org.apache.maven.lifecycle.internal.concurrent.BuildPlanExecutor$BuildContext.<init>(
BuildPlanExecutor.java:216)

    at
org.apache.maven.lifecycle.internal.concurrent.BuildPlanExecutor.execute(
BuildPlanExecutor.java:192)

    at
org.apache.maven.lifecycle.internal.concurrent.ConcurrentLifecycleStarter.execute(
ConcurrentLifecycleStarter.java:108)

    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:311)

    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:226)

    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:149)

    at org.apache.maven.cling.invoker.mvn.MavenInvoker.doExecute(
MavenInvoker.java:452)

    at org.apache.maven.cling.invoker.mvn.MavenInvoker.execute(
MavenInvoker.java:97)

    at org.apache.maven.cling.invoker.mvn.MavenInvoker.execute(
MavenInvoker.java:81)

    at org.apache.maven.cling.invoker.LookupInvoker.doInvoke(
LookupInvoker.java:170)

    at org.apache.maven.cling.invoker.LookupInvoker.invoke(
LookupInvoker.java:139)

    at org.apache.maven.cling.ClingSupport.run(ClingSupport.java:76)

    at org.apache.maven.cling.MavenCling.main(MavenCling.java:72)

    at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(
DirectMethodHandleAccessor.java:104)

    at java.lang.reflect.Method.invoke(Method.java:565)

    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(
Launcher.java:255)

    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(
Launcher.java:201)

    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(
Launcher.java:362)

    at org.codehaus.plexus.classworlds.launcher.Launcher.main(
Launcher.java:314)




On Sun, Nov 29, 2026 at 4:24 PM Sergey Chernov <[email protected]>
wrote:

> I've seen the suggestion to get rid of MultiThreadedBuilder in one of the
> recent topics (which I strongly advise not to do (-1), at least not in 4.0),
> so I decided to recheck the current state of the concurrent builder
> (-bconcurrent) for our project.
>
> The 4.0.0-rc-7 simply failed with an error which seems to be fixed in the
> current maven-4.0.x branch:
>
> [ERROR] The builder requested using id = concurrent cannot be found -> [Help
> 1]
>
> org.apache.maven.lifecycle.internal.builder.BuilderNotFoundException: The
> builder requested using id = concurrent cannot be found
>
>     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (
> LifecycleStarter.java:108)
>
>     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
>
>     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
>
>     at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
>
>     at org.apache.maven.cli.MavenCli.execute (MavenCli.java:919)
>
>     at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:285)
>
>     at org.apache.maven.cli.MavenCli.main (MavenCli.java:207)
>
>     at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (
> DirectMethodHandleAccessor.java:104)
>
>     at java.lang.reflect.Method.invoke (Method.java:565)
>
>     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (
> Launcher.java:255)
>
>     at org.codehaus.plexus.classworlds.launcher.Launcher.launch (
> Launcher.java:201)
>
>     at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode
> (Launcher.java:361)
>
>     at org.codehaus.plexus.classworlds.launcher.Launcher.main (
> Launcher.java:314)
>
>
> Tried with the latest build from the branch, now this failure above is
> gone, but the build performance is quite poor.
> For comparison, simple mvn validate -bmultithreaded takes 0.5 sec on both
> 3.9.16 and 4.0.0-SNAPSHOT, but it takes 80 seconds for mvn validate
> -bconcurrent. Worth to mention: in the reproducer the validate has
> literally 0 mapped plugin goals, so this is a pure builder overhead.
>
> In the past I've shared the server_subset reproducer project with Tamas
> and Guillaume. I've rechecked, it still shows the problem.
> I made a small Claude analysis, below is the machine output:
>
>> The build isn't deadlocked. It finished with BUILD SUCCESS, but it spent
>> minutes with the six builder threads at about 100% CPU. The log sat still
>> for long stretches, which is why it looks hung.
>
> What the dumps show
>> - All 6 BuilderThread-* threads are RUNNABLE in every snapshot. They sit
>> in BuildPlanExecutor$BuildContext.executePlan at lines 542–544, inside
>> stream().allMatch(BuildStep::isDone). Each has used about 3s of CPU per
>> snapshot interval.
>> - The main thread is parked in PhasingExecutor.close, waiting for those
>> builders.
>> - No threads are blocked on locks, and jstack reports no deadlock.
>
> Likely root cause: a quadratic scheduler in the concurrent builder
>> (-bconcurrent)
>> - After every step finishes, the thread that ran it calls executePlan()
>> (BuildPlanExecutor.java:~513). That call scans plan.sortedNodes() and, for
>> each node still in CREATED state, runs predecessors.allMatch(isDone).
>> - This repo has about 1,100 modules, and each module has many lifecycle
>> steps (setup, plan, each phase, teardown, and the after:* steps). So the
>> plan has tens of thousands of nodes.
>> - Every completed step triggers a full scan of all not-yet-started nodes.
>> That is O(steps²) work in total.
>> - Steps that end up skipped call executePlan() recursively, which makes
>> it worse.
>> - The scan holds the read lock. The plan() call takes the write lock on
>> each module's PLAN step, so the scans and the planning steps block each
>> other.
>> - The Skipping Rule Enforcement lines for config-tools show the log is
>> moving, but each real step is swamped by scheduling overhead.
>
>
>> Possible fixes
>> - Maintain a ready queue or a per-step counter of unfinished predecessors
>> that is decremented on completion, instead of rescanning the whole plan.
>> - Only scan the successors of the step that just finished.
>
>
>
>
>
>
>
>
>
>
>

Reply via email to