An open API service indexing awesome lists of open source software.

https://github.com/validator/maven-plugin


https://github.com/validator/maven-plugin

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# nvu-maven-plugin

maven plugin for HTML validation, using the [Nu Html Checker (v.Nu)](https://validator.github.io/)

The plugin can be configured to be run in the *valdiation* phase of the maven
build and cause the build to fail in case errors are reported.

## Usage

Add the plugin to your pom.xml:




nu.validator
vnu-maven-plugin
1.0.0





validate





...
...


[...]



The configuration is also made in the pom.xml. There are defaults in place,
you only need to configure at least one fileset to point to the files to be
validated.

The fileset configuration consists of a directory (relative to the maven
project root) and an optional ant glob directive to filter the contents of
the directory. Directories are scanned recursively by default. Example:


src/main/resources/templates
**.html

The validator can also be configured:


WARN
HTML


...


Here, all settings are optional.

### Handling warnings

By default, warnings are displayed as such and don't cause the build to
fail. It can be configured through the directive:

- WARN (default) - show warnings
- IGNORE - supress warnings
- ERROR - treat as errors (affects filtering, see below)

### Forcing file type

By default, the file type (html/xhtml, css, svg) is determined by the
file extension. Through the directive, it is possible to
force all files to be considered on of types HTML, CSS, SVG or XHTML.

### Filtering

It is possible to filter warnings and/or errors based on (WARN,
ERROR, ALL, optional, default ALL) and a . Filtered items
are completely ignored. Mutiple filters can be configured. Example:


Duplicate ID "[a-zA-Z0-9.]*"
ERROR

## Additional (general) options

### Failfast

Fail on first error (default is to process all errors and fail in the end
if there are errors)

true

### ASCII / Unicode quotes

By default, quotes in the errors messages will be displayed as ASCII quotes.
It is possible to switch to unicode quites by setting this option to 'false'

false