Hmm okay then something very strange is happening as when I type mvn site it attempts to compile my code again, then instrument the classes for cobertura again (only now generates 0 byte length classes doing so) and then dies running the unit tests via surefire.
i don't have the source code for the fixed plugin, jason z just sent me the jar and i installed it manually into my repository. I just copied the pom.xml from the old cobertura polugin so that's possibly the cause of my problems. I have now update my pom.xml to use cobertura 1.7 but i get the exact same problem as before - mvn install works fine but mvn site reinstruments the classes and leaves them as 0 byte class files, causing surefire to die.
Now here's where it gets weird too...
If I comment out the cobertura lines from the reporting section of my project's pom.xml and, from a clean start type mvn install site the build and install part happens fine but I get the same errors with surefire trying to run against 0 byte length instrumented class files during the site phase.
BUT: if i clean it all out and then first type mvn install and let that build okay, then as a separate task type mvn site with no cobertura data in the reporting section, then the site builds fine sans the cobertura reports.
so mvn install site - fails.
mvn install
then mvn site - works.
but only without any reference to conbertura in the reporting part of my project's pom.xml
so now as an experiment I have removed any references to cobertura at all from the pom and lo and behold running mvn install site works perfectly.
however looking at my consol I can see that when the site phase starts maven reports 'preparing sureffire report' then it indeed does attempt to recompile (but there have been no code changes obviously), then runs checkstyle and pmd and findbugs again, then compiles the tests (nothing to compile obviosuly), then runs the tests again, then site:site runs and the javadocs are generated and various reports and it's done.
so something in my reporting is casuing maven to attempt to recompile with al of the subsequent activity attached to the compile phase, but the presence of the cobertura plugin really screws it up.
so my questions:
1) could someone with a working (with maven 2.0.2) cobertura plugin please send it to me with the correct pom.xml - jason z only sent me the compiled plugin without any pom.xml so it is entirely possible this is a big part of my problem.
2) why would [mvn install site] fail, but separate [mvn install] followed by [mvn site] work okay? (once i have removed cobertura from the reporting)
3) if the site phase is not supposed to trigger the compile and other phases then why would it be doing so, with or without the presence of the cobertura plugin?
All this used to work fine using maven 2.0, and i was supposed to demo this last friday so you can imagine my frustration.
Any idea when the fixed cobertura plugin will be released properly? It's really not very acceptable to update the core maven project and then expect that we'll know to go build some plugins from source because they have been broken by the upgrade. I would prefer to see more comprehensive testing followed by simultanious release of a new core with new plugins and some mention in the release notes of any gotchas. As it is I am fighting an uphill battle to be able to recommend use of maven 2 for production systems as I have not been able to demonstrate that it is in fact stable for even pilot-project use.
Kind regards,
Dave Sag
Brett Porter <[EMAIL PROTECTED]> wrote on 27-01-2006 21:50:36:
> On 1/28/06, David Sag <[EMAIL PROTECTED]> wrote:
> >
> > 1) why does mvn site now trigger the other phases of the lifecycle. is
> > this supposed to happen?
>
>
> no.
>
> 2) anyone else using cobertura having this problem?
>
>
> nope.
>
> 3) do i need to update my core cobertura libs too or is version 1.6 still
> > okay for use with the 2.0 version of the plugin?
> >
> >
> The POM from the plugin I'm using has 1.7. How do you mean "my cobertura
> libs"? The plugin source should have specified the version.
>
> - Brett