Details

    • Number of attachments :
      0

      Description

      When running mvn -P flex sonar:sonar, it fails when executing sonar.

      A cpd.xml file is generated, but apparently when importing into sonar it fails.

      Brief Error:

      [INFO] task-segment: [com.adobe.ac:flex-pmd-cpd-maven-plugin:1.0:check]
      [INFO] ------------------------------------------------------------------------
      [INFO] [flex-pmd-cpd:check

      {execution: default-cli}

      ]
      [INFO] Execute maven plugin flex-pmd-cpd-maven-plugin done: 6890 ms
      [INFO] Sensor org.sonar.plugins.flex.cpd.FlexCpdMavenSensor@161c602...
      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] Can not execute Sonar

      Embedded error: Can not analyze the project

      Full Exception (maven -X):

      Caused by: org.apache.maven.plugin.MojoExecutionException: Can not analyze the project
      at org.sonar.maven2.BatchMojo.executeBatch(BatchMojo.java:143)
      at org.sonar.maven2.BatchMojo.execute(BatchMojo.java:122)
      at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
      at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:82)
      ... 21 more
      Caused by: java.lang.NullPointerException
      at org.sonar.plugins.flex.cpd.FlexCpdMavenSensor$ClassDuplicationData.cumulate(FlexCpdMavenSensor.java:152)
      at org.sonar.plugins.flex.cpd.FlexCpdMavenSensor.processClassMeasure(FlexCpdMavenSensor.java:133)
      at org.sonar.plugins.flex.cpd.FlexCpdMavenSensor.collect(FlexCpdMavenSensor.java:85)
      at org.sonar.plugins.flex.cpd.FlexCpdMavenSensor.analyse(FlexCpdMavenSensor.java:66)
      at org.sonar.batch.SensorsExecutor.execute(SensorsExecutor.java:58)
      at org.sonar.batch.ProjectBatch.execute(ProjectBatch.java:54)
      at org.sonar.batch.AggregatorBatch.analyzeProject(AggregatorBatch.java:98)
      at org.sonar.batch.AggregatorBatch.analyzeProjects(AggregatorBatch.java:90)
      at org.sonar.batch.AggregatorBatch.execute(AggregatorBatch.java:74)
      at org.sonar.maven2.BatchMojo.executeBatch(BatchMojo.java:140)
      ... 24 more

        Activity

        Hide
        Ryan added a comment -

        With further testing/debugging, I found

        context.getResource(targetResource)

        is returning null for several files. It appears to return null if the file is a .mxml, instead of a .as.

        I am not familiar enough with sonar to know if this is a configuration issue somewhere to allow it to see .mxml files? I believe cpd is working properly, and that it is a sonar lookup issue.

        Show
        Ryan added a comment - With further testing/debugging, I found context.getResource(targetResource) is returning null for several files. It appears to return null if the file is a .mxml, instead of a .as. I am not familiar enough with sonar to know if this is a configuration issue somewhere to allow it to see .mxml files? I believe cpd is working properly, and that it is a sonar lookup issue.
        Hide
        Olivier Gaudin added a comment -

        I have identified the issue and will fix it tomorrow

        Show
        Olivier Gaudin added a comment - I have identified the issue and will fix it tomorrow
        Hide
        Olivier Gaudin added a comment -

        Issue is fixed and the snapshot version is available on the plugin page

        Show
        Olivier Gaudin added a comment - Issue is fixed and the snapshot version is available on the plugin page

          People

          • Assignee:
            Olivier Gaudin
            Reporter:
            Ryan
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: