-
Notifications
You must be signed in to change notification settings - Fork 0
Maven related cheatsheet
modem_down edited this page Jun 6, 2017
·
1 revision
To validate a POM against its schema, we can use a one-liner combination of:
-
xmllint
(which identifies which element, if any, is invalid); -
xmlstarlet
(which allows us to extract the schema attribute); - GNU
grep
(which allows us to extract the XSD's URL from the schema attribute):
xmllint --noout --schema $(xmlstarlet sel -t -v "/_:project/@xsi:schemaLocation" -n pom.xml | grep -o 'http[^ ]*.xsd') pom.xml
The content of this wiki is © ContentMine. You may use it under the terms of the Creative Commons Attribution 4.0 (CC BY 4.0) license.