diff --git a/src/main/java/org/apache/maven/reporting/exec/DefaultMavenReportExecutor.java b/src/main/java/org/apache/maven/reporting/exec/DefaultMavenReportExecutor.java index 3564db4..5a732a6 100644 --- a/src/main/java/org/apache/maven/reporting/exec/DefaultMavenReportExecutor.java +++ b/src/main/java/org/apache/maven/reporting/exec/DefaultMavenReportExecutor.java @@ -112,15 +112,24 @@ public class DefaultMavenReportExecutor implements MavenReportExecutor { private final PluginVersionResolver pluginVersionResolver; /** - * All packages which are imported from the Site plugin ClassRealm to the report plugin ClassRealm. - * This should correlate to the list of artifacts excluded via {@link #EXCLUDES} (although imports are always considered first). + * All packages which are imported from the Site plugin ClassRealm to the report plugin ClassRealm, overriding classes/packages from the actual report plugin classloader if any.
+ * This should correlate to the list of artifacts excluded via {@link #EXCLUDES} (imports are always considered first). * The given package names are used as prefix, so all classes/resources from the given packages and their sub-packages are imported. + * + * The order of loading is the following: + *
    + *
  1. imported classes/resources from the Site plugin ClassRealm (only the ones from the given packages/classes)
  2. + *
  3. classes/resources from the report plugin ClassRealm (except the ones from the given packages)
  4. + *
  5. classes/resources from the parent ClassLoader (Site plugin ClassRealm) (except from the EXCLUDED artifacts).
  6. + *
*/ private static final List IMPORTS = Arrays.asList( "org.apache.maven.reporting", "org.apache.maven.doxia.siterenderer", - "org.apache.maven.doxia.macro", - "org.apache.maven.doxia.parser", + // prevent Macros/ParserModules from being imported and excluded as otherwise they might be registered + // twice in the MacroManager/ParserModuleManager (not separated between m-site-p and reporting-p) + // as both would implement the same interface from the m-s-p classloader + // use those in the versions being referenced in the reporting-plugin "org.apache.maven.doxia.sink", "org.apache.maven.doxia.util"); @@ -129,7 +138,7 @@ public class DefaultMavenReportExecutor implements MavenReportExecutor { * This must correlate to the list of packages imported in {@link #IMPORTS}. */ private static final List EXCLUDES = - Arrays.asList("doxia-sink-api", "doxia-core", "doxia-site-renderer", "maven-reporting-api"); + Arrays.asList("doxia-sink-api", "doxia-site-renderer", "maven-reporting-api"); @Inject public DefaultMavenReportExecutor(