Maven
  1. Maven
  2. MNG-4162

Removal of all reporting logic from the core of Maven

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0-beta-1
    • Component/s: None
    • Labels:
      None

      Description

      Any reporting implementation will be implemented as a plugin. Maven will provide any information, APIs, and extension points to make this possible. But the conflation of building with reporting in the core makes it almost impossible for anyone to understand the distinction, makes it impossible to have alternate implementations and couple many tools like Doxia directly to the core which is unacceptable for Maven 3.x.

      1. MNG-4162.patch
        16 kB
        Olivier Lamy (*$^¨%`£)

        Issue Links

          Activity

          Show
          Olivier Lamy (*$^¨%`£) added a comment - branches started : core : https://svn.apache.org/repos/asf/maven/components/branches/MNG-4162/ site plugin : https://svn.apache.org/repos/asf/maven/plugins/branches/maven-site-plugin-3.x
          Hide
          Olivier Lamy (*$^¨%`£) added a comment -

          I have commit stuff in core branch.
          No big chance only new methods and some move from private to public.
          No objections to merge to trunk ?

          Show
          Olivier Lamy (*$^¨%`£) added a comment - I have commit stuff in core branch. No big chance only new methods and some move from private to public. No objections to merge to trunk ?
          Hide
          Olivier Lamy (*$^¨%`£) added a comment -

          The approach used creating for each report plugin : creating a new ClassRealm with parent maven-site-plugin-realm with parent core realm.
          Following imported from maven-site-plugin realm :

          • org.apache.maven.reporting.MavenReport
          • org.codehaus.doxia.sink.Sink
          • org.apache.maven.doxia.sink.Sink
          • org.apache.maven.doxia.sink.SinkEventAttributes

          Note need to add org.apache.maven.artifact.manager.WagonConfigurationException in compat.
          So I now have the famous issue with :

                  ... 15 more
          Caused by: java.lang.NoSuchMethodError: org.codehaus.plexus.PlexusContainer.getLoggerManager()Lorg/codehaus/plexus/logging/LoggerManager;
                  at org.apache.maven.report.projectinfo.DependenciesReport.executeReport(DependenciesReport.java:222)
                  at org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:90)
                  at org.apache.maven.plugins.site.ReportDocumentRenderer.renderDocument(ReportDocumentRenderer.java:145)
                  ... 19 more
          
          Show
          Olivier Lamy (*$^¨%`£) added a comment - The approach used creating for each report plugin : creating a new ClassRealm with parent maven-site-plugin-realm with parent core realm. Following imported from maven-site-plugin realm : org.apache.maven.reporting.MavenReport org.codehaus.doxia.sink.Sink org.apache.maven.doxia.sink.Sink org.apache.maven.doxia.sink.SinkEventAttributes Note need to add org.apache.maven.artifact.manager.WagonConfigurationException in compat. So I now have the famous issue with : ... 15 more Caused by: java.lang.NoSuchMethodError: org.codehaus.plexus.PlexusContainer.getLoggerManager()Lorg/codehaus/plexus/logging/LoggerManager; at org.apache.maven.report.projectinfo.DependenciesReport.executeReport(DependenciesReport.java:222) at org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:90) at org.apache.maven.plugins.site.ReportDocumentRenderer.renderDocument(ReportDocumentRenderer.java:145) ... 19 more
          Hide
          Olivier Lamy (*$^¨%`£) added a comment -

          note rev 800978 is needed for be able to use maven-project-info-reports-plugin.

          Show
          Olivier Lamy (*$^¨%`£) added a comment - note rev 800978 is needed for be able to use maven-project-info-reports-plugin.
          Hide
          Olivier Lamy (*$^¨%`£) added a comment -

          So it looks to works fine now.
          Please review core branches.
          Note no huge hack has been added only new methods.
          Please review before merging.
          Thanks

          Show
          Olivier Lamy (*$^¨%`£) added a comment - So it looks to works fine now. Please review core branches. Note no huge hack has been added only new methods. Please review before merging. Thanks
          Hide
          Olivier Lamy (*$^¨%`£) added a comment -

          merge from branch MNG-4162

          Show
          Olivier Lamy (*$^¨%`£) added a comment - merge from branch MNG-4162
          Hide
          Benjamin Bentmann added a comment -

          Olivier, we can't consume the patch as is. The problem is that the Site Plugin heavily reuses the plugin manager. However, the plugin manager is coded to support build plugins, i.e. makes certain assumptions about its use. With the Site Plugin reusing it in its current form, we would for instance end up with plugin realms for build and report plugins getting crippled and hard to debug class loading errors during reactor builds.

          I'm going to look into refactoring the plugin manager. I envision a little layering where we have some general-purpose plugin management components on top of which both the core's plugin manager and the Site Plugin's plugin manager can easily support build plugins and report plugins, respectively.

          Show
          Benjamin Bentmann added a comment - Olivier, we can't consume the patch as is. The problem is that the Site Plugin heavily reuses the plugin manager. However, the plugin manager is coded to support build plugins, i.e. makes certain assumptions about its use. With the Site Plugin reusing it in its current form, we would for instance end up with plugin realms for build and report plugins getting crippled and hard to debug class loading errors during reactor builds. I'm going to look into refactoring the plugin manager. I envision a little layering where we have some general-purpose plugin management components on top of which both the core's plugin manager and the Site Plugin's plugin manager can easily support build plugins and report plugins, respectively.
          Hide
          Olivier Lamy (*$^¨%`£) added a comment -

          first part of this working. Currently only for "simple" report plugins.
          Now we have to work with complicated report plugins which fork lifecycle (surefire report, cobertura).

          Show
          Olivier Lamy (*$^¨%`£) added a comment - first part of this working. Currently only for "simple" report plugins. Now we have to work with complicated report plugins which fork lifecycle (surefire report, cobertura).
          Hide
          Jason van Zyl added a comment -

          This is all done isn't it, the site plugin just doesn't work 100% right?

          Show
          Jason van Zyl added a comment - This is all done isn't it, the site plugin just doesn't work 100% right?
          Hide
          Olivier Lamy (*$^¨%`£) added a comment -

          I have to review the its and understand the failures. (https://grid.sonatype.org/ci/view/Maven%203.0.x/job/maven-site-plugin-3.x/).
          It looks something has changed (in classworld I think) and now some reporting plugins breaks.
          But I haven't yet investigated.

          Show
          Olivier Lamy (*$^¨%`£) added a comment - I have to review the its and understand the failures. ( https://grid.sonatype.org/ci/view/Maven%203.0.x/job/maven-site-plugin-3.x/ ). It looks something has changed (in classworld I think) and now some reporting plugins breaks. But I haven't yet investigated.
          Hide
          Benjamin Bentmann added a comment -

          The converter of the <reporting> section is finished and the new Site Plugin is flipped over to use its own configuration, ITs look good.

          Show
          Benjamin Bentmann added a comment - The converter of the <reporting> section is finished and the new Site Plugin is flipped over to use its own configuration, ITs look good.
          Hide
          Christopher Hunt added a comment -

          Am I correct in assuming that the 2.x reporting section of a pom file is completely incompatible with Maven 3? This has been my observation at least, and I suspect that it will impact on the uptake of Maven 3. I understand the motivation in factoring out the report plugin from core, but I would favour deprecation of the reporting section in the pom over removal in order to have Maven 3 become widely adopted.

          Show
          Christopher Hunt added a comment - Am I correct in assuming that the 2.x reporting section of a pom file is completely incompatible with Maven 3? This has been my observation at least, and I suspect that it will impact on the uptake of Maven 3. I understand the motivation in factoring out the report plugin from core, but I would favour deprecation of the reporting section in the pom over removal in order to have Maven 3 become widely adopted.
          Hide
          Dennis Lundberg added a comment -

          Christopher, the Site Plugin for Maven 3 has a built-in converter, that is able to read the <reporting> section of a POM and convert it into the new model used in Maven 3. So it is possible to use <reporting> with Maven 3. Read more on the Site Plugin 3.x site:
          http://maven.apache.org/plugins/maven-site-plugin-3.0-beta-3/maven-3.html

          Show
          Dennis Lundberg added a comment - Christopher, the Site Plugin for Maven 3 has a built-in converter, that is able to read the <reporting> section of a POM and convert it into the new model used in Maven 3. So it is possible to use <reporting> with Maven 3. Read more on the Site Plugin 3.x site: http://maven.apache.org/plugins/maven-site-plugin-3.0-beta-3/maven-3.html

            People

            • Assignee:
              Benjamin Bentmann
              Reporter:
              Jason van Zyl
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development