From 8caa84a288826a5dfcfea7014e98210fd0d93b54 Mon Sep 17 00:00:00 2001 From: Fabrizio Giustina Date: Sun, 16 Oct 2005 18:23:35 +0000 Subject: [PATCH] the canGenerateReport() has just been added to MavenReport: calling it from the site plugin makes all the plugins compiled with an earlier version fail with an AbstractMethodError. This is intended as a temporary patch to keep the site plugin compatible with existing reports. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@322499 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/maven/plugins/site/SiteMojo.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/maven-plugins/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteMojo.java b/maven-plugins/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteMojo.java index a52b7f8249..0188a322c7 100644 --- a/maven-plugins/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteMojo.java +++ b/maven-plugins/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteMojo.java @@ -404,8 +404,21 @@ public class SiteMojo for ( Iterator i = reports.iterator(); i.hasNext(); ) { MavenReport report = (MavenReport) i.next(); - if ( report.canGenerateReport() ) + try { + if ( report.canGenerateReport() ) + { + filteredReports.add( report ); + } + } + // the canGenerateReport() has been added just before the 2.0 release and will cause all the reporting + // plugins with an earlier version to fail (most of the codehaus mojo now fails) + // be nice with them, output a warning and don't let them break anything + catch ( AbstractMethodError e ) + { + getLog().warn( + "Error loading report " + report.getClass().getName() + + " - AbstractMethodError: canGenerateReport()" ); filteredReports.add( report ); } }