commit 26fa23a666c4a8331bb64e1d223a3cc7edfe829e
Author: Mikolaj Izdebski <mizdebsk(a)redhat.com>
Date: Mon Dec 10 11:03:17 2012 +0100
Force explicit XML namespace in POM files
scripts/pom_editor.sh | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/scripts/pom_editor.sh b/scripts/pom_editor.sh
index 9cd3756..1d0749d 100644
--- a/scripts/pom_editor.sh
+++ b/scripts/pom_editor.sh
@@ -82,6 +82,12 @@ _pom_patch()
# Create a backup file -- pom.xml.orig.
test -f "${pom}".orig || cp -p "${pom}"{,.orig}
+ # Most of POM files specify XML namespace explicitly, but some of
+ # them don't. In order to be able to process all POMs in a uniform
+ # way we force explicit namespace declaration here. (An assumption
+ # is made that model version is 4.0.0.)
+ sed -i 's|<project>|<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">|' "${pom}"
+
# Apply identity transformation.
xsltproc --nonet - "${pom}" >"${pom}".tmp
<<<"${_pom_xslt_header}${_pom_xslt_trailer}"