Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9044577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T11:01:18+00:00 2026-06-16T11:01:18+00:00

I am working on adding checkstyle to the build process of a java project.

  • 0

I am working on adding checkstyle to the build process of a java project. The results of the checkstyle will be later displayed on jenkins. I am using java7 & netbeans 7.2.1

For most of the work I am following the instructions on this page: http://checkstyle.sourceforge.net/anttask.html

However, i’m a beginner in java (& jenkins) and some of the instructions do not make sense to me:

1- The doc says: “To use the task in a build file, you will need the following taskdef declaration: “.
Question: is this to be added in the build.xml file? or where?

2- Then the doc goes on describing a set of parameters and provides some examples. Are these to be added to build.xml too? or?

3- Checkstyle uses a configuration file. I’ll be using the standard sun_checks.xml. Where should this be placed?

If someone can point me out to a step by step tutorial for the whole process, i’d be most grateful.
Thx in advance for all answers

I am using the following in my build.xml:

<taskdef resource="checkstyletask.properties"
     classpath="libs/checkstyle-5.6-all.jar"/>

<target name="checkstyle"
        description="Generates a report of code convention violations.">

    <checkstyle config="sun_checks.xml"
                  failureProperty="checkstyle.failure"
                  failOnViolation="false">
        <fileset dir="src" includes="**/*.java"/>
        <formatter type="xml" toFile="checkstyle-results.xml"/>
    </checkstyle>

    <style in="checkstyle-results.xml" out="checkstyle_report.html" style="checkstyle.xsl"/>

</target>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T11:01:19+00:00Added an answer on June 16, 2026 at 11:01 am
    1. yes, you must add it in your build.xml

    2. These attributes and elements are attributes and elements of the <checkstyle> ant task, which you can use in your build file thanks to the taskdef you have added in point 1. And yes, this <checkstyle> task must be used in your build.xml.

    3. You place it wherever you want. you just need to give its path to the <checkstyle> task using its config attribute.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on adding logging to a project using Windsor Logging Facility and the
I working on adding file uploading to my web application. I'm using an iframe
I am working on adding facebook SSO and the SDK to my project. All
I am working on a large number adding program (without using biginteger class). I
I'm am currently working on a program in java which requires adding a small
I've been working on adding icloud to my project (which is quite a pain
So I'm currently working on adding a recommendation engine to a Django project and
I'm working on adding a way to pull for results in my jQuery.JamCity .
I'm working on adding some Ajax to a web page that I have using
I am working on adding a modal popup to ASP.NET pages. The popup will

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.