views:

20

answers:

1

I am running checkstyle checks from an ant task. I have configured both properly and can run the task without any problems.

But I have another project/folder with additional source files (lets call them third party sources) which are referenced from within my source files (primary source). I want checkstyle to only check the primary sources, but it needs the third party sources in the classpath or somehow, otherwise I get ClassNotFound Errors.

Any suggestions how to do this?

My configuration in ant looks like the following:

<checkstyle config="sun_checks.xml" failOnViolation="false" >
    <fileset dir="${src.dir}" includes="**/*.java" />
    <formatter type="xml" toFile="${report.dir}/checkstyle_sun.xml" />
</checkstyle>
A: 

There is a classpath parameter you can set for the checkstyle task:

classpath The classpath to use when looking up classes. Defaults to the current classpath.

mattjames
How could I not see that one...
Nils Schmidt