Sometimes you need XML validation in your build process. Often configuration files will be read on load time. Not till then validation failures occurs. The Maven XML Plugin validates XML files in your project at build time.
You have only add the following build plugin in pom.xml file:
<build>
<plugins>
...
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xml-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>validate</goal>
</goals>
</execution>
</executions>
<configuration>
<validationSets>
<validationSet>
<dir>xml</dir>
</validationSet>
<validationSet>
<dir>xsd</dir>
<systemId>xmlschema.xml</systemId>
</validationSet>
</validationSets>
</configuration>
</plugin>
...
</plugins>
</build>
RegardsRafael Sobek
Technorati Tags: Maven Maven Plugin XML Validation
