In my case I think I got it with V2.0 of the plugin as well. One possibility
is the way I programmed my plugin. The surefire on appears to fork off a new
process to run tests. Mine does not. Reading through the cobertura doco I
found a comment saying that cobertrua does not write the log file until the
JVM is closed. It may be that because my plugin is running in the same JVM
that the log is not written until after it has been porerted. I'm looking
into this further. Another possibility is that the cobertura logging is not
happening at all because when I check the cobertura log file after the run,
there is no data appended to it (going on file size). I cannot find anywhere
else in the system where it may have been written so I'm still trying to
absolutely confirm that my plugin is running the correct classes.

Overall this is very difficult to debug because of the cobertura
instrumenting and the lack of clear doco on just how maven2 deals with
things such as lifecycle.xml files, etc so if any has some tips on debugging
this please let fly ;-)

ciao
Derek




Bob Allison-2 wrote:
> 
> I thought you were using Maven 2.  The Maven 2 plugin v2.1 uses Cobertura 
> 1.8 which exhibits this problem.  By downgrading the plugin to v2.0, you
> use 
> v1.7 of Cobertura which does not have this problem.
> 
> ----- Original Message ----- 
> From: "Ralph Goers" <[EMAIL PROTECTED]>
> To: "Maven Developers List" <dev@maven.apache.org>
> Sent: Wednesday, February 07, 2007 9:14 AM
> Subject: Re: Lifecycle issues with Cobertura plugin and custom plugin
> 
> 
>> What is this well known problem. I tried upgrading the plugin for maven 
>> 1.0.2 from version 1.1.1 of cobertura to 1.3 and have the same problem - 
>> all the reports show 0 coverage.
>>
>> Ralph
>>
>> Bob Allison wrote:
>>> Sounds like the well-known Cobertura 2.1 problem.  Try explicitly 
>>> specifying version 2.0 of the plugin and see if that fixes it.
>>>
>>> ----- Original Message ----- From: "drekka" 
>>> <[EMAIL PROTECTED]>
>>> To: <dev@maven.apache.org>
>>> Sent: Wednesday, February 07, 2007 1:13 AM
>>> Subject: Lifecycle issues with Cobertura plugin and custom plugin
>>>
>>>
>>>>
>>>> Hi guys,
>>>> I've been trying to nut this out for a couple of days now and need your
>>>> help. A few weeks ago I wrote a Junit4 plugin which works perfectly in 
>>>> the
>>>> test phase. It doesn't fork or anything fancy, just gets on with the 
>>>> job.
>>>> It's header contains the following annotations:
>>>>
>>>> * @requiresDependencyResolution test
>>>> * @goal runJunit4Tests
>>>> * @phase test
>>>>
>>>> However when I added the Cobertrua plugin to the mix, the cobertura 
>>>> report
>>>> keeps reporting 0% coverage. The logs indicate that my plugin is
>>>> working 
>>>> and
>>>> using the generated-classes/cobertura/ directory. It also indicates
>>>> that 
>>>> the
>>>> classes are being instrumented correctly. yet looking at the .ser file
>>>> cobertura uses it would appear that either the
>>>> instrumented classes are not logging correctly or not being used as 
>>>> nothing
>>>> is appended to the file.
>>>>
>>>> This lead me to conclude that there is something wrong with the way
>>>> I've
>>>> setup the plugin within maven. From reading the source of the cobertura
>>>> plugin it appears that the plugin forks a new process to run the test 
>>>> phase
>>>> again. At this point I'm not sure what happens as the maven doco is 
>>>> really
>>>> hard to follow and leave me with more questions than answers. The logs
>>>> indicate that the test are run twice. Once before instrumenting and
>>>> once
>>>> after. I've looked for any direct connection between the surefire and
>>>> cobertura plugins but cannot see anything.
>>>>
>>>> Any ideas guys ?
>>>>
>>>> ciao
>>>> Derek
>>>> -- 
>>>> View this message in context: 
>>>> http://www.nabble.com/Lifecycle-issues-with-Cobertura-plugin-and-custom-plugin-tf3185205s177.html#a8840433
>>>> Sent from the Maven Developers mailing list archive at Nabble.com.
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Lifecycle-issues-with-Cobertura-plugin-and-custom-plugin-tf3185205s177.html#a8855667
Sent from the Maven Developers mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to