maven-plugins/pom/plugin.jelly
bwalding b8ba9ce577 An alternative way of validating the POM. Doesn't use the XSD as XSD doesn't take into
account interpolation and inheritance.  This does not replace the XSD validation, merely enhances it.


git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@112863 13f79535-47bb-0310-9956-ffa450edef68
2003-02-09 13:26:40 +00:00

72 lines
1.9 KiB
XML

<?xml version="1.0"?>
<project
xmlns:j="jelly:core"
xmlns:d="jelly:define"
xmlns:v="jelly:validate"
xmlns:x="jelly:xml"
xmlns:pom="pom">
<!-- set up validation tag library -->
<d:taglib uri="pom">
<d:jellybean
name="validate"
className="org.apache.maven.Validator"
method="execute"
/>
<d:jellybean
name="contentvalidator"
className="org.apache.maven.ContentValidator"
method="execute"
/>
</d:taglib>
<!-- default goal -->
<goal name="pom" description="Validate the Maven XML project descriptor"
prereqs="pom:validate" />
<!-- ================================================================== -->
<!-- V A L I D A T E P O M -->
<!-- ================================================================== -->
<goal
name="pom:validate"
description="Validate the Maven XML project descriptor">
<pom:validate
validator="${maven.home}/maven-project.xsd"
projectDescriptor="project.xml"
/>
<echo>POM is valid</echo>
</goal>
<goal
name="pom:contentvalidate"
description="Validate the content of the Maven POM">
<j:new className="org.apache.maven.ContentValidator" var="contentvalidator"/>
<j:setProperties object="${contentvalidator}" project="${pom}"/>
<j:set var="notices" value="${contentvalidator.execute()}"/>
<j:forEach var="notice" items="${notices}">
<echo>${notice.Level} : ${notice.Section} : ${notice.Message}</echo>
</j:forEach>
</goal>
<!-- ================================================================== -->
<!-- U P D A T E P O M -->
<!-- ================================================================== -->
<goal
name="pom:update"
description="Update the POM from its current version to a specified version">
</goal>
</project>