Skip to content

Crash on multi module project when benchmark is set and parallel building is active #656

Description

@AB-xdev

Affected version

3.7.0

Bug description

When <benchmark>true</benchmark> is set on a mult-maven module project and I run mvn test pmd:aggregate-pmd-no-fork pmd:check -T2C (parallel building active!) the following crash happens:

(cleaned up version because the error is present like 6 times and everything overlaps)

Using the MultiThreadedBuilder implementation with a thread count of 32
...
[INFO] >>> pmd:3.27.0:check (default-cli) > :pmd @ integration-tests >>>
[INFO] 
[INFO] >>> pmd:3.27.0:check (default-cli) > :pmd @ domain >>>
[INFO] 
...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for redacted 4.0.0-SNAPSHOT:
[INFO] 
[INFO] redacted ........................................... SUCCESS [  0.023 s]
[INFO] domain ............................................. FAILURE [  1.332 s]
[INFO] domain-metamodel ................................... SUCCESS [  2.580 s]
[INFO] infrastructure-persistence ......................... SUCCESS [  1.474 s]
[INFO] session-api ........................................ FAILURE [  1.241 s]
[INFO] xxxxxxxxxxxx ....................................... SUCCESS [  0.119 s]
[INFO] application ........................................ SUCCESS [  1.311 s]
[INFO] external-connector ................................. SUCCESS [  1.019 s]
[INFO] webapp-dev-xxxxxx .................................. FAILURE [  1.235 s]
[INFO] xxxxxx-spring-boot-starter-optimized ............... SUCCESS [  0.496 s]
[INFO] xxxxxx-shared-meta ................................. FAILURE [  1.239 s]
[INFO] xxxxxx-shared ...................................... SUCCESS [  0.144 s]
[INFO] external-connector-xxxxxx-ui ....................... SUCCESS [  0.795 s]
[INFO] integration-tests .................................. SUCCESS [  0.028 s]
[INFO] tci-db ............................................. SUCCESS [  0.577 s]
[INFO] infrastructure-persistence-testcontainers .......... SUCCESS [  0.873 s]
[INFO] xxxx-api-client .................................... SUCCESS [  1.271 s]
[INFO] tci-xxxx ........................................... SUCCESS [  0.204 s]
[INFO] tci-redacted-webapp ................................ FAILURE [  1.212 s]
[INFO] xxxxxxxxxxxx-xxxx .................................. SUCCESS [  0.613 s]
[INFO] webapp-meta ........................................ SUCCESS [  0.090 s]
[INFO] webapp-xxxx-elements ............................... SUCCESS [  0.136 s]
[INFO] webapp-xxxx ........................................ SUCCESS [  1.101 s]
[INFO] xxxxxxxxxxxx-xxxx-xxxxxx-ui ........................ SUCCESS [  0.833 s]
[INFO] timetracker ........................................ SUCCESS [  0.104 s]
[INFO] timetracker-xxxxxxx ................................ SUCCESS [  0.088 s]
[INFO] timetracker-xxxxxxx-xxxxxx-ui ...................... SUCCESS [  0.672 s]
[INFO] xxxxxx-xxxxx-plugin ................................ SUCCESS [  3.711 s]
[INFO] webapp ............................................. SUCCESS [  4.698 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  20.960 s (Wall Clock)
[INFO] Finished at: 2025-08-28T09:37:29+02:00
[INFO] ------------------------------------------------------------------------
...
Failed to execute goal org.apache.maven.plugins:maven-pmd-plugin:3.27.0:pmd (pmd) on project domain: Execution pmd of goal org.apache.maven.plugins:maven-pmd-plugin:3.27.0:pmd failed: Cannot invoke "net.sourceforge.pmd.benchmark.TimingReport.getLabeledMeasurements(net.sourceforge.pmd.benchmark.TimedOperationCategory)" because "report" is null
Caused by: java.lang.NullPointerException: Cannot invoke "net.sourceforge.pmd.benchmark.TimingReport.getLabeledMeasurements(net.sourceforge.pmd.benchmark.TimedOperationCategory)" because "report" is null
    at net.sourceforge.pmd.benchmark.TextTimingReportRenderer.render (TextTimingReportRenderer.java:43)
    at org.apache.maven.plugins.pmd.exec.PmdExecutor.writeBenchmarkReport (PmdExecutor.java:274)
    at org.apache.maven.plugins.pmd.exec.PmdExecutor.run (PmdExecutor.java:206)
    at org.apache.maven.plugins.pmd.exec.PmdServiceExecutor.execute (PmdServiceExecutor.java:54)
    at org.apache.maven.plugins.pmd.PmdReport.executePmd (PmdReport.java:373)
    at org.apache.maven.plugins.pmd.PmdReport.canGenerateReport (PmdReport.java:327)
    at org.apache.maven.reporting.AbstractMavenReport.execute (AbstractMavenReport.java:200)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.MojoExecutor.executeForkedExecutions (MojoExecutor.java:448)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:311)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:193)
    at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:180)
    at java.util.concurrent.FutureTask.run (FutureTask.java:317)
    at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:572)
    at java.util.concurrent.FutureTask.run (FutureTask.java:317)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1144)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:642)
    at java.lang.Thread.run (Thread.java:1583)

The problem is not present when parallel building is disabled.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions