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:32 UTC

[maven-archetype] 01/02: [ARCHETYPE-582] Additional module in generated POM should should keep line indentation 2 chars

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 764145b4625f946cf4c3607aab668d2a6ab36dd8
Author: tibordigana <ti...@apache.org>
AuthorDate: Sun Aug 18 23:05:03 2019 +0200

    [ARCHETYPE-582] Additional module in generated POM should should keep line indentation 2 chars
---
 .../main/java/org/apache/maven/archetype/common/util/PomUtils.java | 7 +++++++
 1 file changed, 7 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 a27f125..55c2f1b 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
@@ -113,8 +113,15 @@ public final class PomUtils
                 modules = document.createElement( "modules" );
                 project.appendChild( modules );
             }
+
+            // shift the child node by next two spaces after the parent node spaces
+            modules.appendChild( document.createTextNode( "  " ) );
+
             modules.appendChild( module );
 
+            // shift the end tag </modules>
+            modules.appendChild( document.createTextNode( "\n  " ) );
+
             TransformerFactory tf = TransformerFactory.newInstance();
             tf.setAttribute( XMLConstants.ACCESS_EXTERNAL_DTD, "" );
             tf.setAttribute( XMLConstants.ACCESS_EXTERNAL_STYLESHEET, "" );