MPXDOC-87: Make xdoc:validate work
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@290361 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
47ea8bae72
commit
6127a69571
@ -30,6 +30,7 @@
|
|||||||
xmlns:ant="jelly:ant"
|
xmlns:ant="jelly:ant"
|
||||||
xmlns:fmt="jelly:fmt"
|
xmlns:fmt="jelly:fmt"
|
||||||
xmlns:doc="doc"
|
xmlns:doc="doc"
|
||||||
|
xmlns:plugin="plugin"
|
||||||
xmlns:xdoc="jelly:org.apache.maven.xdoc.XdocTagLibrary">
|
xmlns:xdoc="jelly:org.apache.maven.xdoc.XdocTagLibrary">
|
||||||
|
|
||||||
<j:new var="reports" className="java.util.ArrayList"/>
|
<j:new var="reports" className="java.util.ArrayList"/>
|
||||||
@ -729,34 +730,85 @@
|
|||||||
</j:forEach>
|
</j:forEach>
|
||||||
</goal>
|
</goal>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ================================================================== -->
|
||||||
|
<!-- V A L I D A T E N A V I G A T I O N F I L E -->
|
||||||
|
<!-- ================================================================== -->
|
||||||
|
|
||||||
|
<goal name="xdoc:navigation-validate"
|
||||||
|
description="Validate navigation file">
|
||||||
|
|
||||||
|
<available
|
||||||
|
file="${maven.docs.src}/${maven.xdoc.navigation.file}"
|
||||||
|
property="navigationFile.available"/>
|
||||||
|
|
||||||
|
<j:if test="${navigationFile.available}">
|
||||||
|
<maven:get plugin="maven-xdoc-plugin" property="plugin" var="installedPlugin" />
|
||||||
|
<!-- Remove SNAPSHOT -->
|
||||||
|
<j:choose>
|
||||||
|
<j:when test="${installedPlugin.currentVersion.endsWith('-SNAPSHOT')}">
|
||||||
|
<j:set var="currentRelease" value="${installedPlugin.currentVersion.substring(0,pom.currentVersion.length()-9)}"/>
|
||||||
|
</j:when>
|
||||||
|
<j:otherwise>
|
||||||
|
<j:set var="currentRelease" value="${installedPlugin.currentVersion}"/>
|
||||||
|
</j:otherwise>
|
||||||
|
</j:choose>
|
||||||
|
<plugin:validate-xml
|
||||||
|
schema="${plugin.resources}/xsd/maven-navigation-${currentRelease}.xsd"
|
||||||
|
file="${maven.docs.src}/${maven.xdoc.navigation.file}"/>
|
||||||
|
</j:if>
|
||||||
|
|
||||||
|
</goal>
|
||||||
|
|
||||||
<!-- ================================================================== -->
|
<!-- ================================================================== -->
|
||||||
<!-- V A L I D A T E X D O C S -->
|
<!-- V A L I D A T E X D O C S -->
|
||||||
<!-- ================================================================== -->
|
<!-- ================================================================== -->
|
||||||
|
|
||||||
<!-- validate xdocs -->
|
<!-- validate xdocs -->
|
||||||
<goal name="xdoc:validate" prereqs="pom:taglib"
|
<goal name="xdoc:validate" prereqs="xdoc:navigation-validate"
|
||||||
description="Validate xdocs match the schema">
|
description="Validate xdocs match the schema">
|
||||||
|
|
||||||
<available file="${maven.docs.src}" type="dir"
|
<available file="${maven.docs.src}" type="dir"
|
||||||
property="maven.docs.src.available"/>
|
property="maven.docs.src.available"/>
|
||||||
|
|
||||||
<j:if test="${maven.docs.src.available}">
|
<j:if test="${maven.docs.src.available}">
|
||||||
<fileScanner var="navFiles">
|
<fileScanner var="xmlFiles">
|
||||||
<fileset dir="${maven.docs.src}">
|
<fileset dir="${maven.docs.src}">
|
||||||
<patternset>
|
<patternset>
|
||||||
<include name="**/${maven.xdoc.navigation.file}"/>
|
<include name="**/*.xml"/>
|
||||||
|
<exclude name="**/${maven.xdoc.navigation.file}" />
|
||||||
|
<util:tokenize var="files" delim=",">${maven.xdoc.validate.exclude}</util:tokenize>
|
||||||
|
<j:forEach var="pattern" items="${files}">
|
||||||
|
<exclude name="${pattern}" />
|
||||||
|
</j:forEach>
|
||||||
|
<util:tokenize var="files" delim=",">${maven.xdoc.xml.copy}</util:tokenize>
|
||||||
|
<j:forEach var="pattern" items="${files}">
|
||||||
|
<exclude name="${pattern}" />
|
||||||
|
</j:forEach>
|
||||||
</patternset>
|
</patternset>
|
||||||
</fileset>
|
</fileset>
|
||||||
</fileScanner>
|
</fileScanner>
|
||||||
|
<maven:get plugin="maven-xdoc-plugin" property="plugin" var="installedPlugin" />
|
||||||
<j:forEach var="file" items="${navFiles.iterator()}">
|
<!-- Remove SNAPSHOT -->
|
||||||
<echo>Validating ${file}</echo>
|
<j:choose>
|
||||||
<pom:validate validator="${maven.home}/maven-navigation-1.0.xsd"
|
<j:when test="${installedPlugin.currentVersion.endsWith('-SNAPSHOT')}">
|
||||||
projectDescriptor="${file}"/>
|
<j:set var="currentRelease" value="${installedPlugin.currentVersion.substring(0,pom.currentVersion.length()-9)}"/>
|
||||||
|
</j:when>
|
||||||
|
<j:otherwise>
|
||||||
|
<j:set var="currentRelease" value="${installedPlugin.currentVersion}"/>
|
||||||
|
</j:otherwise>
|
||||||
|
</j:choose>
|
||||||
|
<j:forEach var="file" items="${xmlFiles.iterator()}">
|
||||||
|
<plugin:validate-xml
|
||||||
|
schema="${plugin.resources}/dtd/maven-xdoc-${currentRelease}.dtd"
|
||||||
|
file="${file}"/>
|
||||||
</j:forEach>
|
</j:forEach>
|
||||||
</j:if>
|
</j:if>
|
||||||
|
|
||||||
</goal>
|
</goal>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ================================================================== -->
|
<!-- ================================================================== -->
|
||||||
<!-- C O P Y R E S O U R C E S -->
|
<!-- C O P Y R E S O U R C E S -->
|
||||||
<!-- ================================================================== -->
|
<!-- ================================================================== -->
|
||||||
|
|||||||
@ -80,6 +80,10 @@ maven.xdoc.copy.excludes=file.gif,folder-closed.gif,folder-open.gif,icon_alert.g
|
|||||||
# Files not copied unless skin is classic
|
# Files not copied unless skin is classic
|
||||||
maven.xdoc.copy.excludes.classic=external-classic.png,help_logo.gif,icon_arrowfolderclosed1_sml.gif,icon_arrowwaste1_sml.gif,icon_arrowwaste2_sml.gif,icon_doc_lrg.gif,icon_doc_sml.gif,icon_error_lrg.gif,icon_folder_lrg.gif,icon_folder_sml.gif,icon_help_sml.gif,icon_info_lrg.gif,icon_members_lrg.gif,icon_sortdown.gif,icon_sortup.gif,icon_success_lrg.gif,icon_usergroups_lrg.gif,icon_arrowfolderopen2_sml.gif,icon_warning_lrg.gif,newwindow-classic.png,nw_maj_rond.gif,strich.gif,sw_maj_rond.gif,sw_med_rond.gif
|
maven.xdoc.copy.excludes.classic=external-classic.png,help_logo.gif,icon_arrowfolderclosed1_sml.gif,icon_arrowwaste1_sml.gif,icon_arrowwaste2_sml.gif,icon_doc_lrg.gif,icon_doc_sml.gif,icon_error_lrg.gif,icon_folder_lrg.gif,icon_folder_sml.gif,icon_help_sml.gif,icon_info_lrg.gif,icon_members_lrg.gif,icon_sortdown.gif,icon_sortup.gif,icon_success_lrg.gif,icon_usergroups_lrg.gif,icon_arrowfolderopen2_sml.gif,icon_warning_lrg.gif,newwindow-classic.png,nw_maj_rond.gif,strich.gif,sw_maj_rond.gif,sw_med_rond.gif
|
||||||
|
|
||||||
|
# List of xml files (or patterns) to exclude from validation
|
||||||
|
# Note that navigation.xml and ${maven.xdoc.xml.copy} are included implicitly
|
||||||
|
maven.xdoc.validate.exclude=changes.xml
|
||||||
|
|
||||||
#
|
#
|
||||||
# I18N Preferences
|
# I18N Preferences
|
||||||
#
|
#
|
||||||
|
|||||||
@ -2,20 +2,25 @@
|
|||||||
<!ENTITY % XHTML SYSTEM "xhtml1-transitional.ent">
|
<!ENTITY % XHTML SYSTEM "xhtml1-transitional.ent">
|
||||||
%XHTML;
|
%XHTML;
|
||||||
<!ELEMENT document (properties, body)>
|
<!ELEMENT document (properties, body)>
|
||||||
<!ELEMENT properties (title, author)>
|
<!ATTLIST document
|
||||||
|
xmlns CDATA #FIXED ""
|
||||||
|
>
|
||||||
|
<!ELEMENT properties (title, author*)>
|
||||||
<!ELEMENT title (#PCDATA)>
|
<!ELEMENT title (#PCDATA)>
|
||||||
<!ELEMENT author (#PCDATA)>
|
<!ELEMENT author (#PCDATA)>
|
||||||
<!ATTLIST author
|
<!ATTLIST author
|
||||||
email CDATA #REQUIRED
|
email CDATA #REQUIRED
|
||||||
>
|
>
|
||||||
<!ELEMENT body (section)>
|
<!ELEMENT body (section+)>
|
||||||
<!ELEMENT section (subsection+)>
|
<!ELEMENT section (subsection | p | ul | ol | source | div | table)+>
|
||||||
<!ATTLIST section
|
<!ATTLIST section
|
||||||
name CDATA #REQUIRED
|
name CDATA #REQUIRED
|
||||||
|
id CDATA #IMPLIED
|
||||||
>
|
>
|
||||||
<!ELEMENT subsection (p | ul | source)+>
|
<!ELEMENT subsection (p | ul | ol | source | div | table)+>
|
||||||
<!ATTLIST subsection
|
<!ATTLIST subsection
|
||||||
name CDATA #REQUIRED
|
name CDATA #REQUIRED
|
||||||
|
id CDATA #IMPLIED
|
||||||
>
|
>
|
||||||
<!ELEMENT escapeXml ANY>
|
<!ELEMENT escapeXml ANY>
|
||||||
<!ELEMENT source (#PCDATA | escapeXml)*>
|
<!ELEMENT source (#PCDATA | escapeXml)*>
|
||||||
|
|||||||
@ -21,7 +21,6 @@
|
|||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element ref="title"/>
|
<xs:element ref="title"/>
|
||||||
<xs:element ref="head" minOccurs="0"/>
|
|
||||||
<xs:element ref="body"/>
|
<xs:element ref="body"/>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
<xs:attribute name="name" type="xs:string"/>
|
<xs:attribute name="name" type="xs:string"/>
|
||||||
@ -36,16 +35,20 @@
|
|||||||
</xs:simpleContent>
|
</xs:simpleContent>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
<xs:element name="head"/>
|
|
||||||
<xs:element name="body">
|
<xs:element name="body">
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element ref="breadcrumbs" minOccurs="0"/>
|
<xs:element ref="breadcrumbs" minOccurs="0"/>
|
||||||
<xs:element ref="links" minOccurs="0"/>
|
<xs:element ref="links" minOccurs="0"/>
|
||||||
<xs:element ref="menu" minOccurs="0" maxOccurs="unbounded"/>
|
<xs:element ref="menu" minOccurs="0" maxOccurs="unbounded"/>
|
||||||
|
<xs:element ref="search" minOccurs="0"/>
|
||||||
|
<xs:element ref="powered-by" minOccurs="0"/>
|
||||||
|
<xs:element ref="footer" minOccurs="0"/>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
|
<xs:element name="search"/>
|
||||||
|
<xs:element name="footer"/>
|
||||||
<xs:element name="links">
|
<xs:element name="links">
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
@ -72,6 +75,13 @@
|
|||||||
Values - left-header (default), left-footer -->
|
Values - left-header (default), left-footer -->
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
|
<xs:element name="powered-by">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element ref="item" minOccurs="0" maxOccurs="unbounded"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
<xs:element name="item">
|
<xs:element name="item">
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
|
|||||||
@ -27,6 +27,7 @@
|
|||||||
</properties>
|
</properties>
|
||||||
<body>
|
<body>
|
||||||
<release version="1.10" date="in SVN">
|
<release version="1.10" date="in SVN">
|
||||||
|
<action dev="ltheussl" type="fix" issue="MPXDOC-87">Fix <code>xdoc:validate</code>.</action>
|
||||||
<action dev="ltheussl" type="fix" issue="MPXDOC-106" due-to="Jerome Lacoste">One cannot call xdoc:copy-user-resources directly.</action>
|
<action dev="ltheussl" type="fix" issue="MPXDOC-106" due-to="Jerome Lacoste">One cannot call xdoc:copy-user-resources directly.</action>
|
||||||
<action dev="ltheussl" type="add" issue="MPXDOC-126" due-to="Maarten Coene">Add support for more powered-by banners.</action>
|
<action dev="ltheussl" type="add" issue="MPXDOC-126" due-to="Maarten Coene">Add support for more powered-by banners.</action>
|
||||||
<action dev="ltheussl" type="add" issue="MPXDOC-80" due-to="Joerg Schaible">Support global theme.</action>
|
<action dev="ltheussl" type="add" issue="MPXDOC-80" due-to="Joerg Schaible">Support global theme.</action>
|
||||||
|
|||||||
@ -44,10 +44,15 @@
|
|||||||
</description>
|
</description>
|
||||||
</goal>
|
</goal>
|
||||||
<goal>
|
<goal>
|
||||||
<name>init-dvsl-tag</name>
|
<name>xdoc:validate</name>
|
||||||
<description>
|
<description>
|
||||||
This goal defines the <code>DVSL</code> tag library for generating
|
Validates the user xdoc documents.
|
||||||
documentation. A single tag <code>dvsl:dvsl</code> is defined.
|
</description>
|
||||||
|
</goal>
|
||||||
|
<goal>
|
||||||
|
<name>xdoc:navigation-validate</name>
|
||||||
|
<description>
|
||||||
|
Validates the navigation file ${maven.xdoc.navigation.file}.
|
||||||
</description>
|
</description>
|
||||||
</goal>
|
</goal>
|
||||||
<goal>
|
<goal>
|
||||||
|
|||||||
@ -91,6 +91,17 @@
|
|||||||
using a non-classic theme.
|
using a non-classic theme.
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>maven.xdoc.validate.exclude</td>
|
||||||
|
<td>Yes</td>
|
||||||
|
<td>
|
||||||
|
A comma separated list of patterns to specify xml documents that
|
||||||
|
are to be excluded in <code>xdoc:validate</code>. This defaults to
|
||||||
|
<code>${maven.xdoc.navigation.file}</code>,
|
||||||
|
<code>${maven.xdoc.xml.copy}</code>,
|
||||||
|
<code>changes.xml</code>.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</section>
|
</section>
|
||||||
<section name="Localization Properties">
|
<section name="Localization Properties">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user