Skip to content

Compact Maven parallel flag -T<N> in Goals not recognized as parallel buildΒ #9337

Closed

Description

@xerno

Apache NetBeans version

Apache NetBeans 29

What happened

Maven accepts both -T 2 (two tokens) and -T2 (single token) as equivalent parallel build syntax. In the NetBeans Goals field, these naturally produce different nbactions.xml structures:

  • -T 2 -> <goal>-T</goal><goal>2</goal> - works correctly, parallel build detected, output displays fine
  • -T2 -> <goal>-T2</goal> - build runs fine, but Output window throws NPE:
  java.lang.NullPointerException: Cannot read field "type" because "start" is null
      at o.n.m.maven.execute.CommandLineOutputHandler.trimTree(CommandLineOutputHandler.java:588)                                  
      at o.n.m.maven.execute.CommandLineOutputHandler.processExecEvent(CommandLineOutputHandler.java:475)                          
      at o.n.m.maven.execute.CommandLineOutputHandler$Output.run(CommandLineOutputHandler.java:293)  

It appears that the compact form is not recognized as a parallel build, so the output tree-folding stays active and crashes on interleaved events from concurrent modules.

Workaround: Use -T 2 (with space) instead of -T2 in the Goals field.

Language / Project Type / NetBeans Component

Java Maven multi-module project

How to reproduce

  1. Open any Maven multi-module project with at least 2 independent modules
  2. In the Goals field (or directly in nbactions.xml), configure a build action with -T2 as a single goal:
  <goals>                                                                                                                          
      <goal>-T2</goal>                                                                                                             
      <goal>clean</goal>                                                                                                           
      <goal>install</goal>                                        
  </goals>         
  1. Run the action
  2. Observe the Output window β€” build succeeds but the output tree is corrupted and the NPE appears

For comparison, change to -T 2 (two separate goals):

  <goals>                                                                                                                          
      <goal>-T</goal>                                                                                                              
      <goal>2</goal>                                                                                                               
      <goal>clean</goal>                                          
      <goal>install</goal>
  </goals>     

This works correctly.

Did this work correctly in an earlier version?

No / Don't know

Operating System

Mac OS X version 26.5 / aarch64

JDK

OpenJDK 64-Bit Server VM 25.0.2+10-LTS

Apache NetBeans packaging

Apache NetBeans binary zip

Anything else

Related:

Are you willing to submit a pull request?

Yes

Activity

  1. added
    kind:bugBug report or fix
    needs:triageRequires attention from one of the committers
    on Apr 14, 2026
  2. added
    Maven[ci] enable "build tools" tests
    on Apr 14, 2026
  3. added a commit that references this issue on May 6, 2026
    0d8a411
  4. added a commit that references this issue on May 19, 2026
    3224548
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

    Maven[ci] enable "build tools" testskind:bugBug report or fixneeds:triageRequires attention from one of the committers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions