Maven
  1. Maven
  2. MNG-5019

[regression] String-based component lookups performed by report mojos fail with ClassCastException

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.2
    • Fix Version/s: 3.0.3
    • Component/s: Class Loading
    • Labels:
      None
    • Complexity:
      Intermediate
    • Number of attachments :
      0

      Description

      From the IT MSITE-506 of the Site Plugin:

      Caused by: java.lang.ClassCastException: org.codehaus.plexus.archiver.zip.ZipUnArchiver$__plexus6
        at org.codehaus.plexus.archiver.manager.DefaultArchiverManager.getUnArchiver(DefaultArchiverManager.java:76)
        at org.apache.maven.plugin.javadoc.resolver.ResourceResolver.resolveAndUnpack(ResourceResolver.java:357)
        at org.apache.maven.plugin.javadoc.resolver.ResourceResolver.resolveFromArtifacts(ResourceResolver.java:302)
        at org.apache.maven.plugin.javadoc.resolver.ResourceResolver.resolveDependencySourcePaths(ResourceResolver.java:143)
        at org.apache.maven.plugin.javadoc.AbstractJavadocMojo.getDependencySourcePaths(AbstractJavadocMojo.java:2169)
        at org.apache.maven.plugin.javadoc.AbstractJavadocMojo.getSourcePaths(AbstractJavadocMojo.java:2058)
        at org.apache.maven.plugin.javadoc.JavadocReport.canGenerateReport(JavadocReport.java:213)
        at org.apache.maven.plugins.site.DefaultMavenReportExecutor.canGenerateReport(DefaultMavenReportExecutor.java:299)
        at org.apache.maven.plugins.site.DefaultMavenReportExecutor.buildMavenReports(DefaultMavenReportExecutor.java:278) 
      

      Cause is the following container scenario:

        maven-realm
          site-plugin-realm        <-- plexus lookup realm
            javadoc-plugin-realm   <-- TCCL
      

      where both the Site Plugin and the Javadoc Plugin depend on plexus-archiver.

      The way the container resolves string-based roles is to first check the lookup realm, then the TCCL for the interface/component. In the setup above, this ends up using components from the Site Plugin for the execution of the Javadoc Plugin, boom.

      After talking with Stuart, the fix seems to be as simple as just nullifying the lookup realm, thereby consequently using the TCCL for the lookups.

        Issue Links

          Activity

          Hide
          Olivier Lamy added a comment -

          mark this as blocker because it's a regression issue.

          Show
          Olivier Lamy added a comment - mark this as blocker because it's a regression issue.
          Hide
          Olivier Lamy added a comment -

          I don't really understand why you move this back to Major ??
          IMHO it's a blocker regression in 3.0.2 !

          Show
          Olivier Lamy added a comment - I don't really understand why you move this back to Major ?? IMHO it's a blocker regression in 3.0.2 !
          Hide
          Benjamin Bentmann added a comment -

          From JIRA's help about "Blocker"

          Blocks development and/or testing work, production could not run

          This is not quite how I would describe this issue. Maven 3.0.2 works quite well, well enough that both its RC and release were accepted without anybody noticing this regression. And to be clear, just because something is a regression that doesn't mean it's a blocker. If you want to express your preference for this issue and its fix, the proper way is to vote for it.

          Show
          Benjamin Bentmann added a comment - From JIRA's help about "Blocker" Blocks development and/or testing work, production could not run This is not quite how I would describe this issue. Maven 3.0.2 works quite well, well enough that both its RC and release were accepted without anybody noticing this regression. And to be clear, just because something is a regression that doesn't mean it's a blocker. If you want to express your preference for this issue and its fix, the proper way is to vote for it.
          Hide
          Benjamin Bentmann added a comment -

          Fixed in r1074184.

          Show
          Benjamin Bentmann added a comment - Fixed in r1074184 .
          Hide
          Olivier Lamy added a comment -

          Thanks !

          Show
          Olivier Lamy added a comment - Thanks !

            People

            • Assignee:
              Benjamin Bentmann
              Reporter:
              Benjamin Bentmann
            • Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: