Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    May 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unable to successfully run CheckStyle in build.xml

    I am having trouble with adding checkstyle to my build file. I have been attempting to follow the tutorial at http://checkstyle.sourceforge.net/anttask.html as well as look at examples of code that use checkstyles and find solutions to my problem (such as No output from Checkstyle in ANT on stackoverflow), but when I ant build the file (terminal command ant compile jar run), strange stuff happens. I get this whenever I make a small change to the file TeamRegisterPost.java (i.e. whether or not correct spacing or incorrect spacing):

    Buildfile: /home/lakers/NoteTaker/build.xml

    compile:
    [javac] Compiling 1 source file to /home/lakers/NoteTaker/build/classes
    [javac] Note: /home/lakers/NoteTaker/src/TeamRegisterPost.java uses or overrides a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.

    jar:
    [jar] Building jar: /home/lakers/NoteTaker/build/jar/lakers.jar

    run:
    [java] The response code is: 200

    BUILD SUCCESSFUL
    Total time: 1 second

    I think I've inserted the packages in the correct directories. My directory layout is:

    -lakers
    ---NoteTaker
    ------build.xml
    ------analysis
    -----------sun_checks.xml
    -----------bin
    ----------------checkstyle-5.6-all.jar

    Here is part of my buildfile code:

    Code:
    	
    <property name="checkstyle.dir" location="../analysis" />
    <property name="src.dir" location="src" />
    
    ....
    
        <target name="checkstyle">
            <taskdef resource="checkstyletask.properties">
            <classpath>
                <pathelement
                    path="${checkstyle.dir}/bin/checkstyle-5.6-all.jar"/>
            </classpath>
            </taskdef>
    
            <checkstyle config="${checkstyle.dir}/sun_checks.xml">
                <fileset dir="${src.dir}" includes="**/*.java"/>
                <formatter type="plain"/>
            </checkstyle>
        </target>
    The output in the terminal doesn't seem to be correct because isn't checkstyle suppose to determine when the styling is inconsistent instead of whether or not I do a small change or not?
    If anything I said is unclear, please let me know and I will try to clarify. Your help is greatly appreciated.

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,307
    Thanks
    23
    Thanked 612 Times in 611 Posts
    I don't think this has to do with xml, except as a side function. It sounds much more about Java and that should be posted here http://codingforums.com/java-jsp/ so people that can help will read it.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •