I've used the following code to run JSLint as part of the COMPILE phase in Maven.
It downloads jslint4java from maven repository so you don't need anything else.
If JSLint found problems in javascript files, the build will fail.
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<taskdef name="jslint" classname="com.googlecode.jslint4java.ant.JSLintTask" classpath="${settings.localRepository}/com/googlecode/jslint4java/jslint4java-ant/1.4.2/jslint4java-ant-1.4.2.jar" />
<jslint options="white,browser,devel,undef,eqeqeq,plusplus,bitwise,regexp,strict,newcap,immed">
<predef>Ext,Utils</predef>
<formatter type="plain" />
<fileset dir="${basedir}/src/main/resources/META-INF/resources/js" includes="**/*.js" />
</jslint>
</target>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.googlecode.jslint4java</groupId>
<artifactId>jslint4java-ant</artifactId>
<version>1.4.2</version>
</dependency>
</dependencies>
</plugin>