filter out empty xmlns while writing
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@356373 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
1 parent
31bf337aa5
commit
c137ab2e04
1 file changed
+10
-1
@@ -28,6 +28,7 @@ import java.util.Map;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.Namespace;
|
||||
import org.dom4j.Node;
|
||||
import org.dom4j.io.OutputFormat;
|
||||
import org.dom4j.io.SAXReader;
|
||||
@@ -335,7 +336,15 @@ public abstract class AbstractPomTransformer
|
||||
format.setEncoding( encoding );
|
||||
}
|
||||
|
||||
XMLWriter writer = new XMLWriter( format );
|
||||
XMLWriter writer = new XMLWriter( format )
|
||||
{
|
||||
protected boolean isNamespaceDeclaration( Namespace ns )
|
||||
{
|
||||
// this will filter out empty namespaces, only the correct POM ns is allowed
|
||||
return "http://maven.apache.org/POM/3.0.0".equals( ns.getURI() );
|
||||
}
|
||||
};
|
||||
|
||||
writer.setOutputStream( os );
|
||||
writer.write( getDocument() );
|
||||
writer.flush();
|
||||
|
||||
Reference in new issue
Block a user