9 Replies Latest reply on Nov 25, 2009 10:24 AM by berliner.mauer

    Maven : Generate html report

    igreek

      Hi all!

       

      I would like to know how to generate the html report with the maven plugin.

      It's said that "Currently, FlexPMD produces a XML report by default, plus an HTML report when invoked by the Maven site plugin."

       

      I added the section correponding to the FlexPMD in my pom project as following :

                  <plugin>
                      <groupId>com.adobe.ac</groupId>
                      <artifactId>flex-pmd-maven-plugin</artifactId>
                      <version>1.0.RC4</version>
                  </plugin>

       

      but when I do a site generation, it just generates me a pmd.xml report with the violations (good!) but the flexpmd.html report generated is empty (there are just the default informations about my project but nothing about pmd).

       

      If someone has allready configured flexpmd on his maven project, I will be happy to have some help please!

       

      Thanks'

        • 1. Re: Maven : Generate html report
          yocha78

          Hi

           

          I encountered the same problem.

          I used mvn site to generate the report and the flexpmd.html is empty even if pmd.xml is not.

          pmd.xml seems to not be at the right level (in target instead of target\site as it's the case for the java pmd plugin)

           

          Moreover maybe it could be a good idea to call the xml flexpmd.xml to not have conflict with the java one.

           

          Thanks in advance

          • 2. Re: Maven : Generate html report
            doxumd_dox

            Hi

             

            We can generate the html report but, as you can see in the following Figure, it displays each violation twice.

            Do you have any suggestion to avoid this !!?? Thanks !

             

            Flex PMD Report.jpg

            • 3. Re: Maven : Generate html report
              doxumd_dox Level 1

              Ok, we fixed also this problem by putting in comment the line number 90 of FlexPmdHtmlEngine class.

               

              //report.addListener( reportSink );

               

              Also we notice that there is two reports : report and reportSink.

              Two html reports are générated : the first in the "target" directory and the second in the "target/site" directory. May be there is a reason for that.. I don't know... !!???

               

              regards,

              • 4. Re: Maven : Generate html report
                doxumd_dox Level 1

                @yocha78

                 

                pmd.xml seems to not be at the right level (in target instead of target\site as it's the case for the java pmd plugin)

                 

                ==> The pmd.xml must be under "target" directory and also under "target\site".. I think it's the right level !!

                 

                 

                Moreover maybe it could be a good idea to call the xml flexpmd.xml to not have conflict with the java one.

                 

                ==> There is no conflict because the pmd for flex will be generated in your flex project !!

                 

                regards,

                • 5. Re: Maven : Generate html report
                  yocha78 Level 1

                  Thanks for your answer, in fact in my company we use a common pom parent which defines the entire plugin we used inluding pmd.

                  It wasn't a problem to have a pmd.xml empty for java when doing mvn site for flex module it's the reason why I was surprised the pmd java and the pmd flex have the same name.

                  I modifed the flex pom project to disable the java pmd plugin.

                   

                  How do I get your modification to have the flexpmd.html generated?

                   

                  Thanks again,

                  • 6. Re: Maven : Generate html report
                    doxumd_dox Level 1

                    Hi

                     

                    We didn't modify anything to get the HTML report. We just download the source code of "flex-pmd-maven-plugin", modify the version in the pom to "1.0.RC4", and launch "mvn clean install"

                    This will install the plugin and download all dependencies in your MavenRepository

                     

                    Then in the pom of our flex project we define the plugin in the <build><plugins> section and also in the <reporting><plugins> section , like this :

                     

                    <plugin>
                         <groupId>com.adobe.ac</groupId>
                         <artifactId>flex-pmd-maven-plugin</artifactId>
                         <version>1.0.RC4</version>

                    </plugin>

                     

                    Then in the top level of our flex projet (the same level of the pom file) launch "mvn clean site"

                     

                    This will generate the flexpmd.html in the target/site directory.

                     

                    Hope it will help !

                    • 7. Re: Maven : Generate html report
                      yocha78 Level 1

                      I did the same things but It was what I tried before and I still have a pmd.xml inside target but no pmd.xml inside site repository and the flexpmd.html is empty.

                      I don't know, if the site report work only with a specific maven-site-plugin, I tried with the last one 2.0-beta-7.

                       

                      Regards

                       

                      • 8. Re: Maven : Generate html report
                        ledroff Adobe Employee

                        You may wanna reopen this bug, then :

                        http://bugs.adobe.com/jira/browse/FLEXPMD-6

                         

                        Cheers,

                        François

                        • 9. Re: Maven : Generate html report
                          berliner.mauer

                          I noticed that this is fixed in RC5. It is working fine for me.