The {maven-url}[Maven] plugin of HTML Sanity Check (HSC) enables to check generated or native HTML documentation from the Maven build.
Use the following snippet inside a Maven build file:
<plugin>
<groupId>org.aim42.htmlSanityCheck</groupId>
<artifactId>htmlSanityCheck-maven-plugin</artifactId>
<version>{hsc-version}</version> // (1)
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>sanity-check</goal>
</goals>
</execution>
</executions>
<configuration>
<sourceDocuments>
<file>src/file-to-test.html</file> (2)
</sourceDocuments>
<sourceDir>src</sourceDir> (3)
</configuration>
</plugin>
-
Checkout current version
-
List the files you want tio check here.
-
Directory where the HTML files are located.
Important
|
Latest (development) versions
|
This task exposes a few properties as part of its configuration:
sourceDir (mandatory)
|
Directory where the HTML files are located. Type: Directory. |
||
sourceDocuments (optional)
|
An override to process several source files, which may be a subset of all files available in Type: Default: All files in |
||
checkingResultsDir (optional)
|
Directory where the checking results written to. Type: Directory. Default: |
||
junitResultsDir (optional)
|
Directory where the results are written to in JUnit XML format. JUnit XML can be read by many tools, including CI environments. Type: Directory. Default: |
||
failOnErrors (optional)
|
Fail the build if any error was found in the checked pages. Type: Boolean. Default: |
||
httpConnectionTimeout (optional)
|
Timeout for http requests in ms. Type: Integer. Default: |
||
ignoreLocalHost (optional)
|
Ignore localhost as hostname. Type: Boolean. Default: |
||
ignoreIPAddresses (optional)
|
Ignore IP addresses as hostname. Type: Boolean. Default: |
||
checkerClasses (optional)
|
The set of checker classes to be executed. Type: List. Default: All available checker classes. Checker Classes
link:../htmlSanityCheck-core/src/main/java/org/aim42/htmlsanitycheck/check/AllCheckers.java[role=include] |
||
httpWarningCodes (optional)
|
Additional HTTP response codes treated as warning. Type: List. Default: link:../htmlSanityCheck-core/src/main/java/org/aim42/htmlsanitycheck/tools/Web.java[role=include]
// Redirects included
link:../htmlSanityCheck-core/src/main/java/org/aim42/htmlsanitycheck/tools/Web.java[role=include]
|
||
httpErrorCodes (optional)
|
Additional HTTP response codes treated as error. Type: List. Default: link:../htmlSanityCheck-core/src/main/java/org/aim42/htmlsanitycheck/tools/Web.java[role=include] |
||
httpSuccessCodes (optional)
|
Additional HTTP response codes treated as success. Type: List. Default: link:../htmlSanityCheck-core/src/main/java/org/aim42/htmlsanitycheck/tools/Web.java[role=include] |