clover instrumentation exclusion on maven

Hi,

I'm having following error while using clover on my project. It seems clover added lines into a supposed to be empty method. So I'm using this exclusion configuration to excluse all java source that are having "Aspect" in it's name. However, the exclusion seems not working. I can still see the error while compiling.

Any idea why?

I know commenting out on source file using "///CLOVER: OFF" can turn off instrumentation on certain method lines. However I have so many files that I need to add these lines in. So exclusion on file pattern would work better in this case.

Error messages from Maven:

[INFO] --- aspectj-maven-plugin:1.7:compile (default) @ internal-framework ---
[INFO] Showing AJC message detail for messages of types: [error, warning, fail]
[ERROR] Pointcuts without an if() expression should have an empty method body
           /home/willz/git/nsx/mp/proton/internal-framework/target/clover/src-instrumented/com/vmware/nsx/management/idempotency/service/IdempotencyAspect.java:52
private void executionOfIdempotentAnnotatedMethod(Idempotent idempotent) {try{__CLR4_1_1je1je1isgiwyie.R.inc(25129);


[WARNING] no match for this type name: com.vmware.nsx.management.container.dao.impl.GemFireTransactionHandler [Xlint:invalidAbsoluteTypeName]
           /home/willz/git/nsx/mp/proton/internal-framework/target/clover/src-instrumented/com/vmware/nsx/management/container/aspects/TransactionAspectSupport.java:32
@Pointcut(value = " execution(* *(..))  && !within(com.vmware.nsx.management.container.dao.impl.GemFireTransactionHandler)")
                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


[ERROR] Pointcuts without an if() expression should have an empty method body
           /home/willz/git/nsx/mp/proton/internal-framework/target/clover/src-instrumented/com/vmware/nsx/management/container/aspects/TransactionAspectSupport.java:33
private void anyMethodOutsideThisAspect() {try{__CLR4_1_1fbffbfisgiww3n.R.inc(19853);

[ERROR] Pointcuts without an if() expression should have an empty method body
           /home/willz/git/nsx/mp/proton/internal-framework/target/clover/src-instrumented/com/vmware/nsx/management/container/aspects/TransactionAspectSupport.java:43
private void executionOfAnyPublicMethodTransactionalType() {try{__CLR4_1_1fbffbfisgiww3n.R.inc(19854);

[ERROR] Pointcuts without an if() expression should have an empty method body
           /home/willz/git/nsx/mp/proton/internal-framework/target/clover/src-instrumented/com/vmware/nsx/management/container/aspects/TransactionAspectSupport.java:51
private void executionOfTransactionalMethod() {try{__CLR4_1_1fbffbfisgiww3n.R.inc(19855);

[ERROR] Pointcuts without an if() expression should have an empty method body
           /home/willz/git/nsx/mp/proton/internal-framework/target/clover/src-instrumented/com/vmware/nsx/management/container/aspects/TransactionAspectSupport.java:62
protected void transactionalMethodExecution(Object txObject) {try{__CLR4_1_1fbffbfisgiww3n.R.inc(19856);

[ERROR] Pointcuts without an if() expression should have an empty method body
           /home/willz/git/nsx/mp/proton/internal-framework/target/clover/src-instrumented/com/vmware/nsx/management/container/aspects/TransactionalCheckerAspect.java:24
public void annotatedWithTransactional() {try{__CLR4_1_1fblfblisgiww44.R.inc(19857);

 

Pom.xml:

<plugin>
    <groupId>com.atlassian.maven.plugins</groupId>
    <artifactId>clover-maven-plugin</artifactId>
    <version>4.1.1</version>
    <configuration>
    ...
    <excludes>
        <exclude>**/*test/java</exclude>
        <exclude>**/*Test.groovy</exclude>
        <exclude>**/*Aspect.java</exclude>
        <exclude>**/*Aspect*.java</exclude>
        <exclude>**/TransactionalCheckerAspect.java</exclude>
    </excludes>
</configuration>

1 answer

1 vote

Hi Will,

Unfortunately using ///CLOVER:OFF and ///CLOVER:ON is the only way to disable Clover instrumentation on methods.

The methodContexts filter, which is based on method's signature, will not work in this case, because it does not stop instrumenting the method (the method context filter adds a special marker in Clover's database, so that such method can be later excluded in reports). 

Alternatively, you could experiment with the Clover AspectJ Compiler plugin - https://confluence.atlassian.com/display/CLOVER/Clover+AspectJ+Compiler - keep in mind however, that this plugin is not officially supported.

 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 12, 2019 in Confluence

Confluence Admin Certification now $150 for Community Members

More and more people are building their careers with Atlassian, and we want you to be at the front of this wave! Important Dates Start the Certification Prep Course by 2 April 2019 Take your e...

274 views 2 10
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you