Repository navigation
Closed
Closed
Copy link
Labels
Maven[ci] enable "build tools" tests[ci] enable "build tools" testskind:bugBug report or fixBug report or fixneeds:triageRequires attention from one of the committersRequires attention from one of the committers
Description
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
- Open any Maven multi-module project with at least 2 independent modules
- 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>
- Run the action
- 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
Metadata
Metadata
Assignees
Labels
Maven[ci] enable "build tools" tests[ci] enable "build tools" testskind:bugBug report or fixBug report or fixneeds:triageRequires attention from one of the committersRequires attention from one of the committers
Activity
Fix apache#9337 β recognize compact -T<n> and --threads=<n> Maven flags
Merge pull request #9382 from xerno/fix-9337-compact-threads-flag