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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:36:57+00:00 2026-05-28T13:36:57+00:00

I’m trying to get coverage of JBoss AS 7. Here’s my branch: https://github.com/OndraZizka/jboss-as/tree/TS-jacoco When

  • 0

I’m trying to get coverage of JBoss AS 7. Here’s my branch:
https://github.com/OndraZizka/jboss-as/tree/TS-jacoco

When I run mvn clean install -rf testsuite -DallTests -Dcoverage -fae I get (almost) empty jacoco.exec files – just some metadata (size is few bytes).
The JVM arg line used is:

-javaagent:${jbossas.ts.dir}/target/jacoco-jars/agent/jacocoagent.jar=destfile=${basedir}/target/jacoco.exec,includes=${jboss.home}/modules/**/*,excludes=${basedir}/target/classes/**/*,append=true,output=file

This line is passed to Arquillian to use to start JBoss AS 7.
The testsuite runs, the argument is passed (it appears in AS7’s boot.log), but the resulting jacoco.exec file is only few bytes in size. The report of course shows no coverage.

What am I doing wrong?

  • 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-05-28T13:36:58+00:00Added an answer on May 28, 2026 at 1:36 pm

    Resolved – the “includes” and “excludes” parameters of the agent refer to class names, not files.

    Correct JVM agent argument for my case is:

    -javaagent:${jbossas.ts.dir}/target/jacoco-jars/agent/jacocoagent.jar=destfile=${basedir}/target/jacoco.exec,includes=*,excludes=org.jboss.as.test.*,append=true,output=file
    

    My aproach was to configure the maven jacoco plugin to get the argument, and then hard-coded the property into pom.xml since the property generated by the plugin is not passed to the Surefire plugin.

        <profile>
            <id>ts.jacoco.profile</id>
            <activation><property><name>coverage</name></property></activation>
            <properties>
                <jvm.args.jacoco>-javaagent:${jbossas.ts.dir}/target/jacoco-jars/agent/jacocoagent.jar=destfile=${basedir}/target/jacoco.exec,includes=*,excludes=org.jboss.as.test.*,append=true,output=file</jvm.args.jacoco>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>${version.jacoco.plugin}</version>
                        <executions>
                            <execution><id>ts.jacoco-prepare</id>
                                <phase>process-test-classes</phase>
                                <goals><goal>prepare-agent</goal></goals>
                                <configuration>
                                    <append>true</append>
                                    <destFile>target/jacoco.exec</destFile>
                                    <includes>
                                        <include>*</include>
                                    </includes>
                                    <excludes>
                                        <exclude>org.jboss.as.test.*</exclude>
                                    </excludes>
                                    <output>file</output>
                                    <propertyName>jvm.args.jacoco</propertyName>
                                </configuration>
                            </execution>
                            <!-- Doesn't work currently - waiting for JaCoCo to fix this. Moved to the Ant plugin execution. -->
                            <execution><id>ts.jacoco.report</id>
                                <phase>none</phase> <!-- post-integration-test -->
                                <goals><goal>report</goal></goals>
                                <configuration>
                                    <dataFile>target/jacoco.exec</dataFile>
                                    <outputDirectory>target/coverageReport</outputDirectory>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- Copy JaCoCo jars to have them for the Ant plugin. -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <executions>
                            <!-- Copy the ant tasks jar. Needed for ts.jacoco.report-ant . -->
                            <execution> <id>ts.jacoco.dep.ant</id> <goals><goal>copy</goal></goals> <phase>process-test-resources</phase> <inherited>false</inherited>
                                <configuration>
                                    <artifactItems>
                                        <artifactItem><groupId>org.jacoco</groupId><artifactId>org.jacoco.ant</artifactId><version>${version.jacoco.plugin}</version></artifactItem>
                                    </artifactItems>
                                    <stripVersion>true</stripVersion>
                                    <outputDirectory>${basedir}/target/jacoco-jars</outputDirectory>
                                </configuration>
                            </execution>
                            <!-- Copy the agent jar. Needed for ${jvm.args.jacoco} to have this jar on known path.
                                 If the ts.jacoco-prepare worked and really put the value into the property, this might go away. -->
                            <execution> <id>ts.jacoco.dep.agent</id> <goals><goal>unpack</goal></goals> <phase>process-test-resources</phase> <inherited>false</inherited>
                                <configuration>
                                    <artifactItems>
                                        <artifactItem><groupId>org.jacoco</groupId><artifactId>org.jacoco.agent</artifactId><version>${version.jacoco.plugin}</version></artifactItem>
                                    </artifactItems>
                                    <stripVersion>true</stripVersion>
                                    <outputDirectory>${basedir}/target/jacoco-jars/agent</outputDirectory>
                                </configuration>
                            </execution>
    
                        </executions>
                    </plugin>
                    <!-- Ant plugin. -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <!-- DEBUG -->
                            <execution>
                                <id>ts.jacoco.debug</id>
                                <phase>post-integration-test</phase>
                                <goals><goal>run</goal></goals>
                                <inherited>false</inherited>
                                <configuration>
                                    <target>
                                        <echo>Jacoco argline: ${jvm.args.jacoco}</echo>
                                        <echo>Jacoco jar: ${basedir}/target/jacoco-jars/org.jacoco.ant.jar</echo>
                                    </target>
                                </configuration>
                            </execution>
                            <!-- Must be run using Ant due to https://sourceforge.net/tracker/?func=detail&aid=3474708&group_id=177969&atid=883354 -->
                            <execution>
                                <id>ts.jacoco.report-ant</id>
                                <phase>site</phase> <!-- post-integration-test -->
                                <goals><goal>run</goal></goals>
                                <inherited>false</inherited>
                                <configuration>
                                    <target>
                                        <taskdef name="report" classname="org.jacoco.ant.ReportTask">
                                            <classpath path="${basedir}/target/jacoco-jars/org.jacoco.ant.jar"/>
                                        </taskdef>
                                        <echo>Creating JaCoCo test coverage reports...</echo>
                                        <mkdir dir="${basedir}/target/coverage-report"/>
                                        <report>
                                            <executiondata>
                                                <fileset dir="${basedir}">
                                                    <include name="**/target/jacoco.exec"/>
                                                </fileset>
                                            </executiondata>
                                            <structure name="AS 7 project">
                                                <classfiles>
                                                    <fileset dir="${jboss.dist}/modules">
                                                        <include name="**/*.jar"/>
                                                        <!-- We have 2.x in main. -->
                                                        <exclude name="com/sun/jsf-impl/1.*/**/*"/>
                                                        <!-- AS7-3383 - com/sun/codemodel vs. /1.0/com/sun/codemodel -->
                                                        <exclude name="com/sun/xml/**/*"/>
                                                        <exclude name="javax/faces/api/1.2/**/*"/>
                                                        <!-- AS7-3390 -->
                                                        <exclude name="org/apache/commons/beanutils/**/*"/>
                                                        <!-- AS7-3389 -->
                                                        <exclude name="org/python/jython/standalone/**/*"/>
                                                    </fileset>
                                                </classfiles>
                                                <sourcefiles encoding="UTF-8">
                                                    <fileset dir="${jbossas.project.dir}">
                                                        <include name="**/*.java"/>
                                                        <exclude name="testsuite/**/*.java"/>
                                                    </fileset>
                                                </sourcefiles>
                                            </structure>
                                            <html destdir ="${basedir}/target/coverage-report/html"/>
                                            <xml destfile="${basedir}/target/coverage-report/coverage-report.xml"/>
                                            <csv destfile="${basedir}/target/coverage-report/coverage-report.csv"/>
                                        </report>
                                    </target>
                                </configuration>
                            </execution>
                        </executions>
                        <dependencies>
                            <dependency>
                                <groupId>org.jacoco</groupId>
                                <artifactId>org.jacoco.ant</artifactId>
                                <version>${version.jacoco.plugin}</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                </plugins>
            </build>
        </profile>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm trying to create an if statement in PHP that prevents a single post
I am trying to render a haml file in a javascript response like so:
I am trying to loop through a bunch of documents I have to put

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.