-
Patch
-
Resolution: Fixed
-
Trivial
-
None
-
Platform: All, OS: All
The cobertura plugin does not generate reports for maven2 based projects. The
problem ist that the cobertura plugin is programmed against a deprecated api.
Take a look at the patch below:
Index: src/main/java/hudson/plugins/cobertura/CoberturaPublisher.java
===================================================================
— src/main/java/hudson/plugins/cobertura/CoberturaPublisher.java (revision 9030)
+++ src/main/java/hudson/plugins/cobertura/CoberturaPublisher.java (working copy)
@@ -186,7 +186,7 @@
/**
- {@inheritDoc}
*/
- public boolean perform(Build<?, ?> build, Launcher launcher, BuildListener
listener) throws InterruptedException, IOException {
+ public boolean perform(AbstractBuild<?, ?> build, Launcher launcher,
BuildListener listener) throws InterruptedException, IOException {
if (!Result.SUCCESS.equals(build.getResult())) { listener.getLogger().println("Skipping Cobertura coverage report as build was not successful..."); return true; @@ -191,8 +191,9 @@ listener.getLogger().println("Skipping Cobertura coverage report as build was not successful..."); return true; }+
listener.getLogger().println("Publishing Cobertura coverage report..."); - final Project<?, ?> project = build.getParent();
+ final Project<?, ?> project = (Project<?, ?>) build.getProject();
final boolean multipleModuleRoots;
if (project.getScm() instanceof SubversionSCM) {
// hack of the first kind