apache / apache/maven-ear-plugin
NullPointerException on missing Plexus config children in AbstractEarMojo.initializeJbossConfiguration()
- Dominant language
- Java
- Stars
- 14
- Forks
- 29
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 6
Description
## Description
In `AbstractEarMojo.java:329-364`, multiple calls to `jboss.getChild(...)` are not null-checked before calling `.getValue()`:
- Line 329: `jboss.getChild(JbossConfiguration.VERSION).getValue()` — NPE if `` missing
- Lines 334-335: `jboss.getChild(JbossConfiguration.SECURITY_DOMAIN).getValue()` — NPE if missing
- Lines 336-337: `jboss.getChild(JbossConfiguration.UNAUHTHENTICTED_PRINCIPAL).getValue()` — NPE if missing
- Lines 339-340: `jboss.getChild(JbossConfiguration.LOADER_REPOSITORY).getValue()` — NPE if missing
- Lines 349, 351, 363-364: Same pattern
Lines 354-355 of the same method prove that `getChild()` *can* return null, as the author already null-checks it for `dataSources` there. The other 7+ calls are inconsistent and will throw NPE if those config elements are absent.
## Expected behavior
Add null checks consistent with the existing `dataSources` handling pattern.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in AbstractEarMojo.java, lines 329-364, and compare each jboss.getChild(...).getValue() call with the existing dataSources null-check at lines 354-355. Add consistent handling for missing configuration children, then verify that initializeJbossConfiguration() no longer throws NullPointerException when those elements are absent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100