Maven reporting problem

Help
caner
2009-09-14
2013-06-04
  • caner
    caner
    2009-09-14

    I am using  1.2-beta-1 version of maven xradar plugin.I have declared xradar as the last reporting plugin in my pom.xml but when i execute "mvn clean site -P profile1" i have the problem below.It can not find or read another plugin's (eg. checkstyle) xml.When i execute the maven command without clean("mvn site -P profile1), xradar uses xml files generated before and it manages to generate the xradar report.What can be done?

    my pom.xml

          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>javancss-maven-plugin</artifactId>
            <!-version>2.0</version->
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>jdepend-maven-plugin</artifactId>
            <!-version>2.0-beta-2</version->
          </plugin>      
          <plugin>
        <groupId>net.sourceforge.ckjm</groupId>
        <artifactId>maven-ckjm-plugin</artifactId>
        <!-version>0.4</version->
    </plugin>
          <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>emma-maven-plugin</artifactId>
                    <!-version>1.0-alpha-2</version->
          </plugin>
                          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>cobertura-maven-plugin</artifactId>
            <!-version>2.2</version->
          </plugin>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
      </plugin>
     
    <plugin>
      <groupId>net.sf.xradar</groupId>
      <artifactId>maven-xradar-plugin</artifactId>
      <version>1.2-beta-1</version>
        <configuration>
          <autoRadar>true</autoRadar>
          <!-enableCobertura>true</enableCobertura>
          <enableCheckstyle>true</enableCheckstyle>
          <enableCkjm>true</enableCkjm>
          <enablePmd>true</enablePmd>
          <enableCpd>true</enableCpd->      
        </configuration>  
      </plugin>

    problematic part of trace

    Generating "Xradar Last Static Report" report.

    project directory : C:\dev\projects\project1\runtime\trunk\project1-base

    List of the plugins declared in the Pom of this project and
    supported by xradar :

    Plugins supported and used  : javancss-maven-plugin

    Plugins supported and used  : cobertura-maven-plugin

    Plugins supported and used  : maven-checkstyle-plugin

    Plugins supported and used  : maven-jxr-plugin

    Plugins supported and used  : maven-pmd-plugin

    Plugins supported and used  : maven-ckjm-plugin

    Plugins supported and used  : maven-javadoc-plugin

    Plugins supported and used  : jdepend-maven-plugin


    JDepend plugin not found

    Using JDepend as an API

    Classes have been found

    JDepend Analyze starting …

    Report:jdepend

    ->Input file:C:\dev\projects\project1\runtime\trunk\project1-
    base\target\jdepend-report.xml

    Report:ckjm

    ->Input file:C:\dev\projects\project1\runtime\trunk\project1-
    base\target\ckjm-report.xml

    Report ckjm was not added, because C:\dev\projects\project1\runtime\trunk\project1-base\target\ckjm-report.xml does not exist or is not readable.

    Report:cpd

    ->Input file:C:\dev\projects\project1\runtime\trunk\project1-base\target\cpd.xml

    Report cpd was not added, because C:\dev\projects\project1\runtime\trunk\project1-base\target\cpd.xml does not exist or is not readable.

    Report:pmd

    ->Input file:C:\dev\projects\project1\runtime\trunk\project1-
    base\target\pmd.xml

    Report pmd was not added, because C:\dev\projects\project1
    \runtime\trunk\project1-base\target\pmd.xml does not exist or is not readable.
    Report:checkstyle

    ->Input file:C:\dev\projects\project1\runtime\trunk\project1-
    base\target\checkstyle-result.xml

    Report checkstyle was not added, because C:\dev\projects
    \project1\runtime\trunk\project1-base\target\checkstyle-result.xml does not exist or is not readable.

    Report:javancss

    ->Input file:C:\dev\projects\project1\runtime\trunk\project1-base\target\javancss-raw-report.xml

    Report javancss was not added, because C:\dev\projects\project1\runtime\trunk\project1-base\target\javancss-raw-report.xml does not exist or is not readable.

    Report:cobertura

    ->Input file:C:\dev\projects\project1\runtime\trunk\project1-
    base\target\site\cobertura\coverage.xml

    Report cobertura was not added, because C:\dev\projects\project1\runtime\trunk\project1-base\target\site\cobertura\coverage.xml does not exist or is not readable.

     
  • caner
    caner
    2009-09-14

    sorry for the bad encoding.It had no problem while i was writing.I hope this time it will be correct.

              <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>javancss-maven-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>jdepend-maven-plugin</artifactId>
          </plugin>      
          <plugin>
        <groupId>net.sourceforge.ckjm</groupId>
        <artifactId>maven-ckjm-plugin</artifactId>
    </plugin>
          <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>emma-maven-plugin</artifactId>
          </plugin>
                          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>cobertura-maven-plugin</artifactId>
          </plugin>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
      </plugin>
           
    <plugin>
      <groupId>net.sf.xradar</groupId>
      <artifactId>maven-xradar-plugin</artifactId>
      <version>1.2-beta-1</version>
        <configuration>
          <autoRadar>false</autoRadar>      
        </configuration>  
      </plugin>
    </plugins>
    </reporting>
    </profile>

     
  • caner
    caner
    2009-09-14

    Also there is an another interesting error.when i execute mvn site and then mvn net.sf.xradar:maven-xradar-plugin:audit i get the error below.It gives the same error when autoradar is set to true without declaring some of the necessary  plugins(e.g. javancss).I have googled it and tried some suggestions but didn't help.My maven local repository is not in the default directory but its directory(has no white space in it) is declared in settings.xml.any idea for this problem?

    Plugins Missing : maven-javadoc-plugin

    Embedding maven-javadoc-plugin with default's plugin configuration


    BUILD ERROR

    An error has occurred in XRadar static report report generation.

    Embedded error: When not aligning with a user install you must specify a local repository location using the setLocalRepositoryDirectory( File ) method.

     
  • Nicolas  Dordet
    Nicolas Dordet
    2009-09-14

    ok, let's see problem one by one.

    first, due to maven's goals execution strategy on multi-modules project you have to run separately mvn clean then mvn site.

    second, it seems to be a maven problem not an xradar one. by default, Xradar uses plugins' configurations found in the pom and default settings.xml. You might try to run  something equivalent to mvn net.sf.xradar:maven-xradar-plugin:audit -DLocalRepositoryDirectory=path/to/your/repo.

     
  • caner
    caner
    2009-09-15

    As far as i know, it is possible to define multiple goals in one maven command.It is the way we do all the time.(on a multimodule maven project)I didnt understand why i have to run separately mvn clean and mvn site.

    I have declared xradar as the last reporting plugin in pom.xml and i expect that xradar can see and use other plugins' result xml files.(in a  "mvn clean site -P profile1" execution.)Is not xradar capable of generating the report in one execution?Or am i missing something?

     
  • Nicolas  Dordet
    Nicolas Dordet
    2009-09-15

      yes you can launch mvn clean site but the execution is different than executing mvn clean then mvn site in a multi-module project.

    When you doing mvn clean site : maven execute the goal clean then the goal site for all the projects.
    When you doing mvn clean then mvn site : maven execute the goal clean for all the projects THEN the goal site for all the project.
    The execution is different and it could make problem with xradar.
    That's why I recommand to run mvn clean compile then mvn site.

     
  • caner
    caner
    2009-09-15

    it doesnt work either.Xradar needs two consecutive mvn site executions.At the first execution of "site" goal,it cant use some plugins information(
    Report:pmd
    ->Input file:C:\dev\projects\project1\runtime\trunk\project1-cmd\target\pmd.xml
    Report pmd was not added, because C:\dev\projects\project1\runtime\trunk\project1-cmd\target\pmd.xml does not exist or is not readable.)

    When i run mvn clean compile then mvn site,xradar report is generated but only some plugins are included in the report.(Designed for use with JDepend, Java2HTML  and Ant.)If i run one more mvn site,this time all the plugins are included in the report.(Designed for use with Checkstyle, CKJM, JavaNCSS, JDepend, PMD, PMD-CPD, Java2HTML  and Ant)I need to generate the xradar report(with all plugins info in it) in one maven command(in order to use in continuous integration tool)     what can be done?

     
  • Nicolas  Dordet
    Nicolas Dordet
    2009-09-15

    So strange… do you set the parameter autoRadar at true?

     
  • caner
    caner
    2009-09-15

    I have tried both true and false,but no change.I dont understand why it can use only jdepend plugin.Trace of this can be seen above,in my first post.

     
  • Nicolas  Dordet
    Nicolas Dordet
    2009-09-15

    jdepend is used as an api so its execution is different

     
  • caner
    caner
    2009-09-18

    As far as i understand,xradar works before other plugins execute and generate their result(xml files).How can i make xradar work as the last reporting plugin?Adding xradar as the last plugin to the reporting sectiong clearly doesnt work.

     
  • Nicolas  Dordet
    Nicolas Dordet
    2009-09-18

    I made little tests on a windows 7 with jdk 6, it seems to have serious url's problems with this configuration.

    I will open a bug and it will be fixed for the final 1.2 release.

     
  • caner
    caner
    2009-11-06

    Hi,

    I have found a solution.For details,you can look at http://jira.codehaus.org/browse/MNG-3808.

    In short words,plugins/reports are executed in alphabetic order (first by groupId, then by artifactId) and it works fine when i define the groupId as "zz.sf.xradar" (in my local repo).
    Other problem with the 1.2-RC-1 version still continues. I hope, it will be resolved in the final release,so we can use the newest version:)

    Thanks,

    Caner,

     
  • Nicolas  Dordet
    Nicolas Dordet
    2009-11-06

    Thanks for the report.

    So, with this workaround you succed to run maven-xradar-plugin 1.2-RC1 on windows?

     
  • caner
    caner
    2009-11-06

    RC1 version doesnt work with even this workaround.It has the same problem we discussed in other forum subject.The error is:

    Error during page generation

    Embedded error: Error rendering Maven report: Unable to configure Xradar
    C:\dev\projects\project\runtime\trunk\project-base\target\site\xradar\xml\masterreport_final.xml (The system cannot find the file specified)

     
  • Nicolas  Dordet
    Nicolas Dordet
    2009-11-06

    Yes, ok.

    I'm on it … but there is a lot of changes to make the plugin work on windows…

    Thanks again for your contribution