mirror of https://github.com/apache/maven.git
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:
parent
aa07bff6b7
commit
332f8af8e7
|
@ -70,24 +70,14 @@ public final class ApplicationXmlWriter
|
||||||
if ( GenerateApplicationXmlMojo.VERSION_1_3.equals( version ) )
|
if ( GenerateApplicationXmlMojo.VERSION_1_3.equals( version ) )
|
||||||
{
|
{
|
||||||
writer = initializeRootElementOneDotThree( w );
|
writer = initializeRootElementOneDotThree( w );
|
||||||
|
writeDisplayName(displayName, writer);
|
||||||
|
writeDescription(description, writer);
|
||||||
}
|
}
|
||||||
else if ( GenerateApplicationXmlMojo.VERSION_1_4.equals( version ) )
|
else if ( GenerateApplicationXmlMojo.VERSION_1_4.equals( version ) )
|
||||||
{
|
{
|
||||||
writer = initializeRootElementOneDotFour( w );
|
writer = initializeRootElementOneDotFour( w );
|
||||||
}
|
writeDescription(description, writer);
|
||||||
|
writeDisplayName(displayName, writer);
|
||||||
if ( description != null )
|
|
||||||
{
|
|
||||||
writer.startElement( "description" );
|
|
||||||
writer.writeText( description );
|
|
||||||
writer.endElement();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( displayName != null )
|
|
||||||
{
|
|
||||||
writer.startElement( "display-name" );
|
|
||||||
writer.writeText( displayName );
|
|
||||||
writer.endElement();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Iterator i = earModules.iterator();
|
Iterator i = earModules.iterator();
|
||||||
|
@ -101,6 +91,26 @@ public final class ApplicationXmlWriter
|
||||||
close( w );
|
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 )
|
private void close( Writer closeable )
|
||||||
{
|
{
|
||||||
if ( closeable == null )
|
if ( closeable == null )
|
||||||
|
|
Loading…
Reference in New Issue