Maven 1.x Clover Plugin

clover:on does not see updated maven.compile.src.set

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.7
  • Fix Version/s: 1.10
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    2

Description

In our environment, we do generate some source code, so when we
invoke clover:on, the code does not already exist, so the fileset does not contain our code.

So we are now calling clover:on whenever we generate some source code.
This is done after the maven.compile.src.set is modified. The problem is at the second invocation of clover:on, the clover:on goal does not see the new value of maven.compile.src.set.

It looks like ant:pathconvert, does not override a property if it is already set.

Activity

Hide
Eric Lapierre added a comment -

It seems that resetting the property variable to null before invoking the ant:pathconvert solves the problem.

Show
Eric Lapierre added a comment - It seems that resetting the property variable to null before invoking the ant:pathconvert solves the problem.
Hide
Vincent Massol added a comment -

Hi Eric,

Thanks for your patch. I'd like to apply it but I would like to write a test for it to reproduce the pb and to have some regression test available. Do you think you could provide a minimal Maven project that reproduces the pb?

Thanks
-Vincent

Show
Vincent Massol added a comment - Hi Eric, Thanks for your patch. I'd like to apply it but I would like to write a test for it to reproduce the pb and to have some regression test available. Do you think you could provide a minimal Maven project that reproduces the pb? Thanks -Vincent
Hide
Eric Lapierre added a comment -

If you invoke maven clover:on jar:install,
I expect 2 files to be cloverized. The one from src/java and the one from src/generated

Show
Eric Lapierre added a comment - If you invoke maven clover:on jar:install, I expect 2 files to be cloverized. The one from src/java and the one from src/generated
Hide
Vincent Massol added a comment -

Thanks Eric. You should not call clover:on twice. This will lead to unexpected results as it's not a valid use case. You should always call clover:off after calling clover:on.

I'd suggest to add your generated source dir to the maven.compile.src.set ref first and then only call clover:on.

Show
Vincent Massol added a comment - Thanks Eric. You should not call clover:on twice. This will lead to unexpected results as it's not a valid use case. You should always call clover:off after calling clover:on. I'd suggest to add your generated source dir to the maven.compile.src.set ref first and then only call clover:on.
Hide
Eric Lapierre added a comment -

I am using clover with the multiproject plugin.

If I add the generate directory maven.compile.src.set before calling clover:on, I get a compile error for the subprojects that don't have the generate the directory:

Unable to obtain goal [multiproject:install-callback] – /home/ericlap/.maven/cache/maven-java-plugin-1.5/plugin.jelly:63:48: <ant:javac> srcdir "/vobs/oam_platform/base_datamgmt/persistence/target/generate" does not exist!
Total time: 29 seconds

I tried running clover:off before rerunning clover:on without any success. Once I have run clover:on once on a subproject, the fileset is fixed.

Show
Eric Lapierre added a comment - I am using clover with the multiproject plugin. If I add the generate directory maven.compile.src.set before calling clover:on, I get a compile error for the subprojects that don't have the generate the directory: Unable to obtain goal [multiproject:install-callback] – /home/ericlap/.maven/cache/maven-java-plugin-1.5/plugin.jelly:63:48: <ant:javac> srcdir "/vobs/oam_platform/base_datamgmt/persistence/target/generate" does not exist! Total time: 29 seconds I tried running clover:off before rerunning clover:on without any success. Once I have run clover:on once on a subproject, the fileset is fixed.
Hide
Vincent Massol added a comment -

Applied thanks. I have applied it in clover:off rather than clover:on because clover:off must be called before calling clover:on again. Let me know if it works for you.

Show
Vincent Massol added a comment - Applied thanks. I have applied it in clover:off rather than clover:on because clover:off must be called before calling clover:on again. Let me know if it works for you.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: