apache / apache/maven

[MNG-7589] MavenXpp3Writer write empty property with self-closing tag?

Open
#8,876 4 comments 0 reactions 0 assignees View on GitHub
priority:trivial
Dominant language
Java
Stars
5.3k
Forks
3.1k
Avg merge
20h 42m
Merged PRs (30d)
297

Description

**[Jeff Thomas](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=jwt007)** opened **[MNG-7589](https://issues.apache.org/jira/browse/MNG-7589?redirect=false)** and commented

I am using a maven-plugin which manipulates the POM and writes a new POM model.  (similar to 'maven-git-versioning-extension' or 'flatten-maven-plugin').

When writing a POM using the MavenXpp3Writer a property without a value is written out as follows:

 

```java



```

 

Would it be possible to write this out with a self-closing tag? Or provide an option to the writer to do so?

 

```java





```

Its just eye-candy but the IDE (IntelliJ) displays warnings for empty tags and I don't want to disable the check globally. :)

 

Why empty properties?

For some plugins we use empty properties as placeholders which child projects or sub-modules can override.  For example: maven-surefire-plugin `argLine`.  This prevents other IDE errors for missing properties when editing the POM.

 

---

**Affects:** 3.8.6

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.