apache / apache/netbeans

Maven: Superfluous empty lines in parent pom.xml after creating a new child module based on archetype

Open
#6,943 0 comments 1 reaction 0 assignees View on GitHub
kind:bug needs:triage
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Apache NetBeans version

Apache NetBeans 20

### What happened

When adding a new child module based on an archetype to a maven parent project, the pom.xml of the parent project is updated in order to include the new sub-module. However, after the update the pom.xml file contains a lot of additional blank lines (seems to double the number of lines).

### Language / Project Type / NetBeans Component

Java Maven Project with child projects

### How to reproduce

The following steps need to be performed:
- create a new top-level maven project using the "Files -> New Project" and choose the project type "POM Project".
**good**: observe a newly created maven project being opened in NetBeans
- open the generated "pom.xml" file of that project
**good**: observe that it is formatted as expected and **does** not include blank lines after each xml entry.
- create a child module using the popup menu on the "Modules" entry of the maven project and choose "Create New Module"
- within the "New Project" dialog choose "Project from Archetyp" and continue to the next dialog
- choose any of the listed archetypes (e.g. javafx) for the child project and create the project
**good**: the new child project is created and is listed within the "Modules" section of its parent
**bad**: the original pom.xml file of the parent project does contain a lot of superfluous blank lines

### Did this work correctly in an earlier version?

Apache NetBeans 13 or earlier

### Operating System

RedHat Linux

### JDK

JDK 21

### Apache NetBeans packaging

Apache NetBeans binary zip

### Anything else

_No response_

### Are you willing to submit a pull request?

No

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with a POM Project, then create a child module through Modules > Create New Module using a project from an archetype. Inspect the parent pom.xml before and after the module is added; done means the module is included without introducing superfluous blank lines.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.