git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@385084 13f79535-47bb-0310-9956-ffa450edef68
128 lines
4.4 KiB
XML
128 lines
4.4 KiB
XML
<?xml version="1.0"?>
|
|
<!--
|
|
/*
|
|
* Copyright 2001-2004 The Apache Software Foundation.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
-->
|
|
|
|
|
|
<project
|
|
xmlns:j="jelly:core"
|
|
xmlns:define="jelly:define"
|
|
xmlns:linkcheck="linkcheck"
|
|
xmlns:maven="jelly:maven"
|
|
xmlns:ant="jelly:ant"
|
|
xmlns:x="jelly:xml"
|
|
xmlns:util="jelly:util"
|
|
xmlns:log="jelly:log"
|
|
xmlns:doc="doc">
|
|
|
|
<j:set var="loggerName">org.apache.maven.plugin.linkcheck.Jelly</j:set>
|
|
|
|
<goal name="maven-linkcheck-plugin:register">
|
|
<doc:registerReport
|
|
name="Link Check Report"
|
|
pluginName="maven-linkcheck-plugin"
|
|
link="linkcheck"
|
|
description="Report on the validity of all links in the documentation."/>
|
|
<log:debug name="${loggerName}">LinkCheck report registred.</log:debug>
|
|
</goal>
|
|
|
|
<goal name="maven-linkcheck-plugin:deregister">
|
|
<doc:deregisterReport name="Link Check Report"/>
|
|
<log:debug name="${loggerName}">LinkCheck report unregistred.</log:debug>
|
|
</goal>
|
|
|
|
<define:taglib uri="linkcheck">
|
|
<define:jellybean
|
|
name="linkcheck"
|
|
className="org.apache.maven.plugin.linkcheck.LinkCheck"
|
|
method="doExecute"
|
|
/>
|
|
<log:debug name="${loggerName}">LinkCheck taglib defined.</log:debug>
|
|
</define:taglib>
|
|
|
|
<!-- ================================================================== -->
|
|
<!-- C R E A T E L I N K C H E C K X M L R E P O R T -->
|
|
<!-- ================================================================== -->
|
|
|
|
<!-- The reason for the odd goal configuration is this:
|
|
We really don't want the link checker to run until everything else is complete
|
|
-->
|
|
|
|
<goal name="maven-linkcheck-plugin:report">
|
|
<copy file="${plugin.resources}/linkcheck-temp.xml"
|
|
toFile="${maven.gen.docs}/linkcheck.xml"/>
|
|
<log:debug name="${loggerName}">Fake LinkCheck report copied.</log:debug>
|
|
<postGoal name="xdoc:jelly-transform">
|
|
<!-- The linkcheck plugin must be called after any other one.-->
|
|
<attainGoal name="maven-linkcheck-plugin:report-real"/>
|
|
</postGoal>
|
|
</goal>
|
|
|
|
<goal
|
|
name="maven-linkcheck-plugin:report-real"
|
|
description="Generate link check results and then transform to HTML">
|
|
<log:debug name="${loggerName}">Begin to generate the linkcheck report.</log:debug>
|
|
<mkdir dir="${maven.build.dir}/linkcheck"/>
|
|
<mkdir dir="${maven.build.dir}/linkcheck/docs"/>
|
|
|
|
<linkcheck:linkcheck
|
|
project="${pom}"
|
|
cache="${maven.linkcheck.cache}"
|
|
exclude="${maven.linkcheck.exclude}"
|
|
basedir="${maven.docs.dest}"
|
|
output="${maven.build.dir}/linkcheck/linkcheck-results.xml"
|
|
outputEncoding="${maven.docs.outputencoding}"
|
|
method="${maven.linkcheck.method}"
|
|
/>
|
|
|
|
<!-- Do we want an error to be generated if there are link errors? -->
|
|
<j:if test="${context.getVariable('maven.linkcheck.failonerror') == 'true'}">
|
|
<!-- Are there any error? -->
|
|
<util:file var="resultsAsFile"
|
|
name="${maven.build.dir}/linkcheck/linkcheck-results.xml"/>
|
|
<x:parse var="doc" xml="${resultsAsFile}"/>
|
|
<x:if select="$doc//unsuccessful[string() != '0'] | $doc//status[string() != 'OK']">
|
|
<fail>There are broken links.</fail>
|
|
</x:if>
|
|
</j:if>
|
|
|
|
<doc:jslFile
|
|
input="${maven.build.dir}/linkcheck/linkcheck-results.xml"
|
|
output="${maven.build.dir}/linkcheck/docs/linkcheck.xml"
|
|
stylesheet="${plugin.resources}/linkcheck.jsl"
|
|
outputMode="xml"
|
|
prettyPrint="true"
|
|
/>
|
|
|
|
<doc:jslToSite srcdir="${maven.build.dir}/linkcheck/docs"/>
|
|
|
|
<!-- copy images used in the report -->
|
|
<mkdir dir="${maven.docs.dest}/images"/>
|
|
<copy todir="${maven.docs.dest}/images">
|
|
<fileset dir="${plugin.resources}/images"/>
|
|
</copy>
|
|
|
|
</goal>
|
|
|
|
<goal name="maven-linkcheck-plugin:clearcache"
|
|
description="Removes the cache file">
|
|
<delete file="${maven.linkcheck.cache}"/>
|
|
<log:info name="${loggerName}">Cache cleared.</log:info>
|
|
</goal>
|
|
|
|
</project>
|