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

  • Home
  • SEARCH
  • 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 9084677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T21:03:19+00:00 2026-06-16T21:03:19+00:00

So I have a java project in Eclipse. I build the war file via

  • 0

So I have a java project in Eclipse. I build the war file via ant. Which I can invoke from Eclipse, or from the command line or via Jenkins. I am setting up the environment is such a way as to try and keep all three of those ways of building working, and with as little changing of the environment as possible to make it happen.

So I am currently doing the compile, creating the war, generating javadoc, and running junits via my ant build.xml

Trying to add Cobertura code coverage to the mix.

I have installed the Jenkins for Cobertura and I’m now trying to get the junit running to work with Cobertura to properly instrument the classes and generate the coverage file.

The cobertura doc says to start by defining the task as follows.

<property name="cobertura.dir" value="C:/javastuff/cobertura" />

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

<taskdef classpathref="cobertura.classpath" resource="tasks.properties" />

Don’t like that C:\ obviously … I need a valid cobertura.dir … but it is not really obvious how to configure it. Jenkins puts all the classes for the plugin here

.jenkins/plugins/cobertura

And the file structure underneath this is as follows.

drwxrwxr-x 2 vpbuild vpbuild 4096 Jan 4 10:42 images
drwxrwxr-x 3 vpbuild vpbuild 4096 Dec 15 12:36 META-INF
-rw-rw-r– 1 vpbuild vpbuild 0 Jan 4 10:41 .timestamp
drwxrwxr-x 4 vpbuild vpbuild 4096 Dec 15 12:36 WEB-INF

So if this was to be my cobertura.dir there is no lib subdirectory defined here. There is in WEB-INF, but there is no cobertura jar there … so none of it seems quite right.

I have also downloaded the cobertura jar separately, and put that in ANT_HOME/lib, to hopefully assist with making the cobertura tasks more visible to ANT, but not sure how that would affect what I need to do as far as the build.xml.

Anyone have any experience with configuring cobertura so that it can run via ant both within and outside jenkins in this way ? What does the build.xml need to look like to make it happen ?

-Jim

  • 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-16T21:03:20+00:00Added an answer on June 16, 2026 at 9:03 pm

    The Jenkins Cobertura plugin merely processes and displays your code coverage results; it doesn’t include the Cobertura tool itself.

    You should download the latest Cobertura binaries and unpack them into your C:\javastuff\cobertura directory. You’ll then have cobertura.jar plus a lib subdirectory containing the other required dependencies that go into cobertura.classpath.

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

Sidebar

Related Questions

I have a Eclipse-Java-Project with an ANT-build-file. This build file exports a jar of
I have a struts project which, I have imported to eclipse from a war
So I have a Java Project in Eclipse for which I can generate a
I am trying to export a WAR file from Eclipse. I have a Dynamic
I have a war packaging Maven project, in which I have a Java properties
I have a file called build_properties.xml in my Java project, which is not a
I tried to create a jar file from a java project, which uses some
I have a java project in Eclipse that is built through ANT. Normally, I
I have a maven java project in eclipse. I added a groovy file in
I have a Java project in Eclipse with ~10 packages and ~10 class files

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.