Now supports failing the build on error if you set the new <code>maven.linkcheck.failonerror</code> property to <code>true</code>.

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@115159 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
vmassol 2004-05-02 11:15:40 +00:00
parent d3948488fd
commit a12be01ffa
5 changed files with 57 additions and 36 deletions

View File

@ -23,6 +23,8 @@
xmlns:define="jelly:define"
xmlns:linkcheck="linkcheck"
xmlns:maven="jelly:maven"
xmlns:x="jelly:xml"
xmlns:util="jelly:util"
xmlns:doc="doc">
<goal name="maven-linkcheck-plugin:register">
@ -60,8 +62,6 @@
<postGoal name="xdoc:jelly-transform">
<maven:pluginVar var="reports" plugin="maven-xdoc-plugin" property="reports" />
<!-- not sure why the following is being done
<j:set var="context" value="${pom.getPluginContext('maven-xdoc-plugin')}"/> -->
<j:set var="online">${maven.mode.online}</j:set>
@ -89,6 +89,17 @@
output="${maven.build.dir}/linkcheck/linkcheck-results.xml"
outputEncoding="${maven.docs.outputencoding}"
/>
<!-- 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"

View File

@ -17,7 +17,5 @@
# -------------------------------------------------------------------
# P L U G I N P R O P E R I E S
# -------------------------------------------------------------------
# LinkCheck report plugin.
# -------------------------------------------------------------------
maven.linkcheck.cache=${maven.build.dir}/linkcheck/linkcheck.cache
maven.linkcheck.failonerror=false

View File

@ -34,7 +34,29 @@
<developerConnection>scm:cvs:ext:${maven.username}@cvs.apache.org:/home/cvs:maven-plugins/linkcheck/</developerConnection>
<url>http://cvs.apache.org/viewcvs/maven-plugins/linkcheck/</url>
</repository>
<developers/>
<versions>
<version>
<id>1.2</id>
<name>1.2</name>
<tag>MAVEN_LINKCHECK_1_2</tag>
</version>
<version>
<id>1.3</id>
<name>1.3</name>
<tag>HEAD</tag>
</version>
</versions>
<developers>
<developer>
<name>Vincent Massol</name>
<id>vmassol</id>
<email>vmassol@pivolis.com</email>
<organization>Pivolis</organization>
<roles>
<role>Java Developer</role>
</roles>
</developer>
</developers>
<dependencies>
<dependency>
<groupId>commons-beanutils</groupId>

View File

@ -22,9 +22,14 @@
<properties>
<title>Changes</title>
<author email="evenisse@ifrance.com">Emmanuel Venisse</author>
<author email="vmassol@apache.org">Vincent Massol</author>
</properties>
<body>
<release version="1.3-SNAPSHOT" date="in CVS">
<action dev="vmassol" type="add">
Now supports failing the build on error if you set the new
<code>maven.linkcheck.failonerror</code> property to <code>true</code>.
</action>
<action dev="brett" type="fix" issue="MPLINKCHECK-11" due-to="Ralph Apel">Remove commons-util dependency. Must update to commons-lang 2.0.</action>
<action dev="dion" type="fix">Fix issues with DOM classes and jdk1.3</action>
</release>

View File

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/*
* Copyright 2001-2004 The Apache Software Foundation.
@ -17,7 +18,6 @@
*/
-->
<document>
<properties>
<title>LinkCheck Plugin Properties</title>
@ -30,41 +30,26 @@
<th>Optional?</th>
<th>Description</th>
</tr>
<tr>
<td>maven.build.dir</td>
<td>Yes</td>
<td>
<p>Default value is
<code>${basedir}/target</code>.</p>
</td>
</tr>
<tr>
<td>maven.docs.dest</td>
<td>Yes</td>
<td>
<p>Default value is
<code>${maven.build.dir}/docs</code>.</p>
</td>
</tr>
<tr>
<td>maven.docs.outputencoding</td>
<td>Yes</td>
<td>
<p>Default value is
<code>ISO-8859-1</code>.</p>
</td>
</tr>
<tr>
<td>maven.linkcheck.cache</td>
<td>Yes</td>
<td>
<p>Determines where the cache for the linkchecking is stored. Default value is
<code>${maven.build.dir}/linkcheck/linkcheck.cache</code>. This means that
a clean build deletes the cache. If you have an extremely large document tree this
can have a negative effect on performance.</p>
Determines where the cache for the linkchecking is stored.
Default value is
<code>${maven.build.dir}/linkcheck/linkcheck.cache</code>.
This means that a clean build deletes the cache. If you have
an extremely large document tree this can have a negative effect
on performance.
</td>
</tr>
<tr>
<td>maven.linkcheck.failonerror</td>
<td>Yes</td>
<td>
Determines whether the build should fail on broken links or not.
Defaults to <code>false</code>.
</td>
</tr>
</table>
</section>
</body>