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@330981 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stephane Nicoll 2005-11-05 07:31:29 +00:00
parent aa07bff6b7
commit 332f8af8e7
1 changed files with 24 additions and 14 deletions

View File

@ -70,24 +70,14 @@ 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 );
}
if ( description != null )
{
writer.startElement( "description" );
writer.writeText( description );
writer.endElement();
}
if ( displayName != null )
{
writer.startElement( "display-name" );
writer.writeText( displayName );
writer.endElement();
writeDescription(description, writer);
writeDisplayName(displayName, writer);
}
Iterator i = earModules.iterator();
@ -101,6 +91,26 @@ public final class ApplicationXmlWriter
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();
}
}
private void close( Writer closeable )
{
if ( closeable == null )