[ checkstyle-Bugs-2155288 ] resource checkstyletask.properties

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[ checkstyle-Bugs-2155288 ] resource checkstyletask.properties

Bugs item #2155288, was opened at 2008-10-09 17:36
Message generated for change (Comment added) made by marcbeckers
You can respond by visiting:

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: ANT Task
Group: release 4.4
>Status: Closed
Resolution: None
Priority: 5
Private: No
Submitted By: Marc Beckers (marcbeckers)
Assigned to: Oliver Burn (oburn)
Summary: resource checkstyletask.properties

Initial Comment:
I have written a custom check and put it in a jar. When I run the check in NetBeans with the Checkstyle Beans plugin it all works well, but when I run it with Ant I get the following error:

Could not load definitions from resource checkstyletask.properties. It could not be found.
C:\MyData\LocalSubversionWorkingCopy\bla\trunk\projects\BLA\autobuild.xml:43: Problem: failed to create task or type checkstyle
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.

But the file checkstyletask.properties is available in the checkstyle-all-4.4.jar.

What am I doing wrong? Please help me!

Snippet from build.xml:

<target name="checkstyle" depends="init, compile">
    <mkdir dir="${build.checkstyle.dir}"/>
    <taskdef resource="checkstyletask.properties" classpath="${lib.dir}/autobuild/checkstyle/*.jar"/>
    <checkstyle config="${lib.dir}/autobuild/checkstyle/mychecks.xml" failonviolation="false" classpath="${lib.dir}/autobuild/checkstyle/*.jar">
        <formatter type="xml" tofile="${build.checkstyle.dir}/checkstyle.xml"/>
        <fileset dir="${src.dir}" includes="**/*.java"/>
        <classpath path="${build.classes.dir};"/>


>Comment By: Marc Beckers (marcbeckers)
Date: 2008-10-10 10:19

I have fixed the problem by adding a path element:

<path id="checkstyle.classpath">
    <fileset dir="${lib.dir}/autobuild/checkstyle">
        <include name="*.jar"/>

and changing the taskdef element:

<taskdef resource="checkstyletask.properties"



You can respond by visiting:

This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
Checkstyle-devel mailing list
[hidden email]