Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-7589

MavenXpp3Writer write empty property with self-closing tag?

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Open
    • Trivial
    • Resolution: Unresolved
    • 3.8.6
    • None
    • Core
    • None
    • Maven 3.8.6

    Description

      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:

       

      <project>
        <properties>
          <some.property></some.property>
        </properties>
      </project>
      

       

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

       

      <project>
        <properties>
          <some.property/>
        </properties>
      </project> 

      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.

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            JWT007 Jeff Thomas
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: