You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ti...@apache.org on 2019/08/18 21:06:33 UTC

[maven-archetype] 02/02: normalize document POM

This is an automated email from the ASF dual-hosted git repository.

tibordigana pushed a commit to branch release-3.1.2
in repository https://gitbox.apache.org/repos/asf/maven-archetype.git

commit af72ee50bae48222c924f1ca7b86d903de05f77a
Author: tibordigana <ti...@apache.org>
AuthorDate: Sun Aug 18 23:06:17 2019 +0200

    normalize document POM
---
 .../src/main/java/org/apache/maven/archetype/common/util/PomUtils.java  | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/archetype-common/src/main/java/org/apache/maven/archetype/common/util/PomUtils.java b/archetype-common/src/main/java/org/apache/maven/archetype/common/util/PomUtils.java
index 55c2f1b..caea494 100644
--- a/archetype-common/src/main/java/org/apache/maven/archetype/common/util/PomUtils.java
+++ b/archetype-common/src/main/java/org/apache/maven/archetype/common/util/PomUtils.java
@@ -132,6 +132,8 @@ public final class PomUtils
             tr.setOutputProperty( OutputKeys.METHOD, "xml" );
             tr.setOutputProperty( OutputKeys.ENCODING, "UTF-8" );
             tr.setOutputProperty( "{http://xml.apache.org/xslt}indent-amount", "2" );
+            document.getDomConfig().setParameter( "infoset", Boolean.TRUE );
+            document.getDocumentElement().normalize();
             tr.transform( new DOMSource( document ), new StreamResult( fileWriter ) );
             return true;
         }