Mojo
  1. Mojo
  2. MOJO-1292

missing dashboard reports when a report file, to be aggregated, is empty

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: dashboard
    • Labels:
      None
    • Environment:
      $ mvn -version
      Maven version: 2.0.9
      Java version: 1.5.0_11
      OS name: "linux" version: "2.6.25.18-0.2-default" arch: "i386" Family: "unix"
    • Complexity:
      Intermediate
    • Testcase included:
      yes
    • Patch Submitted:
      Yes
    • Number of attachments :
      2

      Description

      In a multi projects setting, the dashboard plugin will miss most reports if a report file to be aggregated is empty.

      Running the command:
      mvn clean site dashboard:dashboard

      results in:
      [ERROR] DashBoardUtils getDocument() SAXException :
      org.xml.sax.SAXParseException: Premature end of file.
      at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
      at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
      at org.codehaus.mojo.dashboard.report.plugin.DashBoardUtils.getDocument(DashBoardUtils.java:890)
      at org.codehaus.mojo.dashboard.report.plugin.DashBoardUtils.getTaglistReport(DashBoardUtils.java:834)
      at org.codehaus.mojo.dashboard.report.plugin.DashBoardUtils.getDashBoardMavenProject(DashBoardUtils.java:308)
      at org.codehaus.mojo.dashboard.report.plugin.DashBoardReportMojo.executeReport(DashBoardReportMojo.java:280)
      at org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:98)
      at org.apache.maven.reporting.AbstractMavenReport.execute(AbstractMavenReport.java:73)
      at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
      at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
      at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
      at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

      1. DashBoardUtils.java.patch
        2 kB
        Jean-Luc Jox

        Activity

        David Vicente made changes -
        Field Original Value New Value
        Assignee David Vicente [ dvicente72 ]
        Hide
        Charlie Collins added a comment -

        I get this exact same problem when using dashboard on a single project (not multi-module).

        [INFO] [dashboard:dashboard]
        [INFO] MultiReportMojo project = Axioma Model Prototype
        [INFO] MultiReportMojo nb modules = 0
        [INFO] MultiReportMojo base directory = /data/ccollins/projects/axioma-model
        [INFO] MultiReportMojo output directory = /data/ccollins/projects/axioma-model/target/site
        [INFO] MultiReportMojo report output directory = /data/ccollins/projects/axioma-model/target/site
        [INFO] MultiReportMojo project language = java
        [Fatal Error] :-1:-1: Premature end of file.
        [ERROR] DashBoardUtils getDocument() SAXException :
        org.xml.sax.SAXParseException: Premature end of file.
        at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        at org.codehaus.mojo.dashboard.report.plugin.DashBoardUtils.getDocument(DashBoardUtils.java:886)

        I am using "standard usage" - nothing tweaked (and dashboard is the last reporting plugin as noted): http://mojo.codehaus.org/dashboard-maven-plugin/usage.html.

        Maven version: 2.0.9
        Java version: 1.6.0_07
        OS name: "linux" version: "2.6.24-22-generic" arch: "i386" Family: "unix"

        Show
        Charlie Collins added a comment - I get this exact same problem when using dashboard on a single project (not multi-module). [INFO] [dashboard:dashboard] [INFO] MultiReportMojo project = Axioma Model Prototype [INFO] MultiReportMojo nb modules = 0 [INFO] MultiReportMojo base directory = /data/ccollins/projects/axioma-model [INFO] MultiReportMojo output directory = /data/ccollins/projects/axioma-model/target/site [INFO] MultiReportMojo report output directory = /data/ccollins/projects/axioma-model/target/site [INFO] MultiReportMojo project language = java [Fatal Error] :-1:-1: Premature end of file. [ERROR] DashBoardUtils getDocument() SAXException : org.xml.sax.SAXParseException: Premature end of file. at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) at org.codehaus.mojo.dashboard.report.plugin.DashBoardUtils.getDocument(DashBoardUtils.java:886) I am using "standard usage" - nothing tweaked (and dashboard is the last reporting plugin as noted): http://mojo.codehaus.org/dashboard-maven-plugin/usage.html . Maven version: 2.0.9 Java version: 1.6.0_07 OS name: "linux" version: "2.6.24-22-generic" arch: "i386" Family: "unix"
        Hide
        Charlie Collins added a comment -

        I added some logging in the neighborhood, and it looks like it is related to the "tags" plugin file.

        [INFO] MultiReportMojo project language = java
        [INFO] xmlFilename - /data/ccollins/projects/axioma-model/target/taglist/taglist.xml
        [Fatal Error] :1:1: Premature end of file.
        [ERROR] DashBoardUtils getDocument() SAXException :
        org.xml.sax.SAXParseException: Premature end of file.

        When I remove the taglist-maven-plugin from my POM, it works fine. Therefore not sure if this is a different issue than reported here, or related or not, but either way some more robust handling of the file name input before parsing (some validation and better log output), along the lines of the patch on this issue, would be helpful.

        Show
        Charlie Collins added a comment - I added some logging in the neighborhood, and it looks like it is related to the "tags" plugin file. [INFO] MultiReportMojo project language = java [INFO] xmlFilename - /data/ccollins/projects/axioma-model/target/taglist/taglist.xml [Fatal Error] :1:1: Premature end of file. [ERROR] DashBoardUtils getDocument() SAXException : org.xml.sax.SAXParseException: Premature end of file. When I remove the taglist-maven-plugin from my POM, it works fine. Therefore not sure if this is a different issue than reported here, or related or not, but either way some more robust handling of the file name input before parsing (some validation and better log output), along the lines of the patch on this issue, would be helpful.
        Hide
        Charlie Collins added a comment -

        I will stop spamming the comments here after this post, I promise .

        I noticed that the taglist plugin sets it's xmlOutputDirectory property to $

        {project.build.directory}/taglist, rather than just ${project.build.directory}

        where this plugin appears to be trying to find it. By setting the taglist one to $

        {project.build.directory}

        it resolves the issue.

        I think this issue and this one: http://jira.codehaus.org/browse/MOJO-987, may be related.

        When looking for the xml output for various things, need to use the properties. (I wasn't aware this plugin was even using taglist, so that confused me, still don't understand it, but either way need to use the defined locations rather than assuming.)

        Also, cool plugin, not trying just to bitch, it's a very helpful addition (I am hoping commenting on issues like this will be helpful, not just a PITA).

        Show
        Charlie Collins added a comment - I will stop spamming the comments here after this post, I promise . I noticed that the taglist plugin sets it's xmlOutputDirectory property to $ {project.build.directory}/taglist, rather than just ${project.build.directory} where this plugin appears to be trying to find it. By setting the taglist one to $ {project.build.directory} it resolves the issue. I think this issue and this one: http://jira.codehaus.org/browse/MOJO-987 , may be related. When looking for the xml output for various things, need to use the properties. (I wasn't aware this plugin was even using taglist, so that confused me, still don't understand it, but either way need to use the defined locations rather than assuming.) Also, cool plugin, not trying just to bitch, it's a very helpful addition (I am hoping commenting on issues like this will be helpful, not just a PITA).

          People

          • Assignee:
            David Vicente
            Reporter:
            Jean-Luc Jox
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: