You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2017/12/20 09:34:09 UTC

[maven-ear-plugin] 06/16: PR: MNG-1402 Submitted by: Tomislav Stojcevich Reviewed by: Stephane Nicoll Fixed compliance of generated application.xml (display-name and description different in 1.3 and 1.4)

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

hboutemy pushed a commit to annotated tag maven-ear-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ear-plugin.git

commit 47599284f9c975ffe64f010ebcbb8a345a9d7a3c
Author: Stephane Nicoll <sn...@apache.org>
AuthorDate: Sat Nov 5 07:31:29 2005 +0000

    PR: MNG-1402
    Submitted by: Tomislav Stojcevich
    Reviewed by: Stephane Nicoll
    Fixed compliance of generated application.xml (display-name and description different in 1.3 and 1.4)
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk/maven-plugins/maven-ear-plugin@330981 13f79535-47bb-0310-9956-ffa450edef68
---
 .../maven/plugin/ear/ApplicationXmlWriter.java     | 30 ++++++++++++++--------
 1 file changed, 20 insertions(+), 10 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugin/ear/ApplicationXmlWriter.java b/src/main/java/org/apache/maven/plugin/ear/ApplicationXmlWriter.java
index 9f1e2a3..b2c8ac8 100644
--- a/src/main/java/org/apache/maven/plugin/ear/ApplicationXmlWriter.java
+++ b/src/main/java/org/apache/maven/plugin/ear/ApplicationXmlWriter.java
@@ -70,35 +70,45 @@ public final class ApplicationXmlWriter
         if ( GenerateApplicationXmlMojo.VERSION_1_3.equals( version ) )
         {
             writer = initializeRootElementOneDotThree( w );
+            writeDisplayName(displayName, writer);
+            writeDescription(description, writer);
         }
         else if ( GenerateApplicationXmlMojo.VERSION_1_4.equals( version ) )
         {
             writer = initializeRootElementOneDotFour( w );
+            writeDescription(description, writer);
+            writeDisplayName(displayName, writer);
         }
 
+        Iterator i = earModules.iterator();
+        while ( i.hasNext() )
+        {
+            EarModule module = (EarModule) i.next();
+            module.appendModule( writer, version );
+        }
+        writer.endElement();
+
+        close( w );
+    }
+
+    private void writeDescription(String description, XMLWriter writer)
+    {
         if ( description != null )
         {
             writer.startElement( "description" );
             writer.writeText( description );
             writer.endElement();
         }
+    }
 
+    private void writeDisplayName(String displayName, XMLWriter writer)
+    {
         if ( displayName != null )
         {
             writer.startElement( "display-name" );
             writer.writeText( displayName );
             writer.endElement();
         }
-
-        Iterator i = earModules.iterator();
-        while ( i.hasNext() )
-        {
-            EarModule module = (EarModule) i.next();
-            module.appendModule( writer, version );
-        }
-        writer.endElement();
-
-        close( w );
     }
 
     private void close( Writer closeable )

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.