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 8728919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:44:14+00:00 2026-06-13T08:44:14+00:00

I want to exclude cobertura from instrumenting code if test=true. Right now I have

  • 0

I want to exclude cobertura from instrumenting code if test=true.

Right now I have all my required statments at the top:

require 'buildr/java/cobertura'
require 'buildr/scala'

Then each time the build runs I get this:

Instrumenting classes with cobertura data file
C:/usr/git_workspaces/reports/cobertura.ser

Which means that my production code has cobertura instrumentation in it.

This is the next section of my build

compile.with  CORE, SLF4J, LOG4J, WS_CLIENTS, JODA_TIME,
            [omitted for brevity]

compile.options.other = %w(-encoding UTF-8)

cobertura.exclude '[omitted for brevity]'

resources.filter.using *RESOURCES_FILTER

test.using :junit
# need this because of forking.  It does not appear to use the environmental variables defined above.
test.using :java_args => ["-XX:MaxPermSize=128M"]
test.with JUNIT, SCALATEST, MOCKITO, POWERMOCK, HAMCREST, SPRING.test

# Pakcage is below here but the code has already been instrumented...

Is the compile.with the place where compilation actually occurs? So I could make an if test then add cobertura ?

  • 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-13T08:44:15+00:00Added an answer on June 13, 2026 at 8:44 am

    if you do not require “buildr/java/cobertura” then there will be no instrumenting.

    We ‘solved’ like this (at least commandline parameter has to include “cobertura” otherwise the classes are not instrumented)

    ARGV.each do |a| 
      if (a.include?("cobertura")) 
        require "buildr/java/cobertura"
        break
      end
    end
    

    You could do this

    require_cb = ture
    ARGV.each do |a|   
        if (a.include?("test=yes"))
        require_cb = false      
        break
      end
    end
    require "buildr/java/cobertura" if require_cb
    

    hth

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

Sidebar

Related Questions

I want to match all URLS but exclude image urls from beeing matched with
I want to exclude all directories from my search in PowerShell. Both FileInfo and
I have a list of words that I want to exclude from some query
How to exclude some of countries from List Menu at below? Now my code
I want to exclude all subfolders named ajax in any folder from indexing by
I have two pages I want to exclude them from the sitemaster so I
I have a list of options (booked seats) from which I want to exclude
I want to exclude the following characters from my string: \-- ' < >
I have the below line in the unix shell script. I want to exclude
I have a custom CMS here entitled phpVMS, and I want to exclude a

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.