Remove xslt transform, it doesn't work with java 5 (?). Extended poms comply with maven-project-3.xsd (in core), root poms with pom-strict-3.xsd.

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@345542 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
ltheussl 2005-11-18 19:24:12 +00:00
parent 69f5c125b9
commit b0bd6ac521
3 changed files with 8 additions and 33 deletions

View File

@ -61,7 +61,8 @@
name="pom:validate"
description="Validate the Maven XML project descriptor">
<j:set var="xsd" value="${plugin.resources}/xsd/pom-strict-3.xsd"/>
<j:set var="xsd"
value="${plugin.resources}/xsd/pom-strict-${pom.pomVersion}.xsd"/>
<util:file var="pomAsFile" name="${pom.file.canonicalPath}" />
<j:if test="${pomAsFile != null}">
@ -82,22 +83,8 @@
*** This parent pom has to be validated separately!
</j:whitespace>
</log:warn>
<j:set var="available" value="false"/>
<util:available file="${plugin.resources}/xsd/pom-extend-3.xsd">
<j:set var="available" value="true"/>
</util:available>
<j:if test="${available == 'false'}">
<j:set var="xsl" value="${plugin.resources}/xsl/pom-extend-3.xsl"/>
<x:transform
xslt="file://${xsl}"
xml="file://${xsd}"
var="tmpVar"
validate="false"/>
<j:file name="${plugin.resources}/xsd/pom-extend-3.xsd">
<x:copyOf select="$tmpVar"/>
</j:file>
</j:if>
<j:set var="xsd" value="${plugin.resources}/xsd/pom-extend-3.xsd"/>
<j:set var="xsd"
value="${maven.home}/maven-project-${pom.pomVersion}.xsd"/>
</j:if>
<log:info>Using xsd file: ${xsd}</log:info>

View File

@ -17,7 +17,7 @@
*/
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://maven.apache.org/POM/3.0.0" targetNamespace="http://maven.apache.org/POM/3.0.0" elementFormDefault="qualified">
<xs:element name="project" type="Model">
<xs:annotation>

View File

@ -1,17 +1,5 @@
Every pom that does not extend another one (a 'root' pom) has to comply
with the schema ${plugin.resources}/xsd/pom-strict-3.xsd.
with the schema ${plugin.resources}/xsd/pom-strict-${pom.pomVersion}.xsd.
Running "pom:validate" on a child pom (a pom that extends another one)
will create another schema ${plugin.resources}/xsd/pom-extend-3.xsd
(if this doesn't exist already) via an xslt transformation using the
stylesheet ${plugin.resources}/xsl/pom-extend-3.xsl. This just replaces
all 'minOccurs="1"' attributes in pom-strict-3.xsd by 'minOccurs="0"'.
Note:
* Every element that is required in a root pom but is not obligatory
in a child pom, needs a 'minOccurs="1"'.
* Elements that are required in both parent and child poms, must not have
a 'minOccurs' attribute (so they default to 1).
A child pom (a pom that extends another one) has to comply
with the schema ${maven.home}/maven-project-${pom.pomVersion}.xsd.