SnK
SnK

Reputation: 528

Jenkins with JSLint and Violations plugin

I currently configured a jenkins server that validates my project on javascript errors with JSlint ( with ant). Now i want to show all the errors with the violation plugin. I can generate an xml with all the errors. But it doesn't show this in the graph.

This is my build.xml:

<?xml version="1.0" encoding="UTF-8"?>

<taskdef name="jslint"
       classname="com.googlecode.jslint4java.ant.JSLintTask"
       classpath="jslint/jslint4java-2.0.2.jar" />

<property name="reports.dir" value="reports" />

<target name="clean" description="Removes output files created by other targets.">
    <delete dir="${reports.dir}" failonerror="true" />
</target>

<target name="jslint" depends="clean">
    <mkdir dir="reports" />
    <jslint options="white,undef,plusplus,newcap,vars,indent=4">
        <predef>jQuery, setTimeout, history, window, document</predef>
        <formatter type="xml" destfile="jslint_results.xml"/> 
        <fileset dir="" includes="**/*.js" excludes="lib/*.js" />
    </jslint>
</target>

This is my violations setting:

violations settings

Upvotes: 3

Views: 4227

Answers (1)

malenkiy_scot
malenkiy_scot

Reputation: 16605

The pattern is relative to your workspace. So if your report 'lives' in <WORKSPACE>/reports the pattern should be reports/jslint_results.xml or **/jslint_results.xml

Upvotes: 2

Related Questions