Sonar Squid Exception

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Sonar Squid Exception

deepak_bisht
Hi,
i encountered the following error after upgrading Sonar form 2.6 to 2.8.
on your previous blogs i found out its regarding java source path. Please specify me where to set that path?
like "in custom workspace" or in "execute windows batch command"?

my build result is:

[INFO] Cobertura Report generation was successful. [INFO] Execute org.codehaus.mojo:cobertura-maven-plugin:2.5:cobertura done: 2734 ms [INFO] Execute maven plugin cobertura-maven-plugin done: 2734 ms [INFO] Initializer CoberturaMavenInitializer... [INFO] Initializer CoberturaMavenInitializer done: 0 ms [INFO] Sensor AsynchronousMeasuresSensor... [INFO] Sensor AsynchronousMeasuresSensor done: 47 ms [INFO] Sensor JavaSourceImporter... [INFO] Sensor JavaSourceImporter done: 31 ms [INFO] Sensor SquidSensor... [INFO] Java AST scan...
[ERROR] Squid Error occurs when analysing :D:\CodingTest\myCode\src\main\java\com\ece\mycode\HelloWorld.java org.sonar.squid.api.AnalysisException: The source directory does not correspond to the package declaration at org.sonar.java.ast.visitor.PackageVisitor.checkPhysicalDirectory(PackageVisitor.java:93) [sonar-squid-java-plugin-2.8.jar:na] at org.sonar.java.ast.visitor.PackageVisitor.createSourcePackage(PackageVisitor.java:75) [sonar-squid-java-plugin-2.8.jar:na] at org.sonar.java.ast.visitor.PackageVisitor.visitFile(PackageVisitor.java:50) [sonar-squid-java-plugin-2.8.jar:na] at org.sonar.java.ast.CheckstyleSquidBridge.beginTree(CheckstyleSquidBridge.java:87) [sonar-squid-java-plugin-2.8.jar:na] at com.puppycrawl.tools.checkstyle.TreeWalker.notifyBegin(TreeWalker.java:349) [checkstyle-5.1.jar:5.1] at com.puppycrawl.tools.checkstyle.TreeWalker.walk(TreeWalker.java:324) [checkstyle-5.1.jar:5.1] at com.puppycrawl.tools.checkstyle.TreeWalker.processFiltered(TreeWalker.java:186) [checkstyle-5.1.jar:5.1] at com.puppycrawl.tools.checkstyle.api.AbstractFileSetCheck.process(AbstractFileSetCheck.java:73) [checkstyle-5.1.jar:5.1] at com.puppycrawl.tools.checkstyle.Checker.process(Checker.java:262) [checkstyle-5.1.jar:5.1] at org.sonar.java.ast.JavaAstScanner.launchCheckstyle(JavaAstScanner.java:129) [sonar-squid-java-plugin-2.8.jar:na] at org.sonar.java.ast.JavaAstScanner.scanFiles(JavaAstScanner.java:118) [sonar-squid-java-plugin-2.8.jar:na] at org.sonar.plugins.squid.SquidExecutor.scanSources(SquidExecutor.java:163) [sonar-squid-java-plugin-2.8.jar:na] at org.sonar.plugins.squid.SquidExecutor.scan(SquidExecutor.java:84) [sonar-squid-java-plugin-2.8.jar:na] at org.sonar.plugins.squid.SquidSensor.analyzeMainSources(SquidSensor.java:78) [sonar-squid-java-plugin-2.8.jar:na] at org.sonar.plugins.squid.SquidSensor.analyse(SquidSensor.java:62) [sonar-squid-java-plugin-2.8.jar:na] at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:58) [sonar-batch-2.8.jar:na] at org.sonar.batch.phases.Phases.execute(Phases.java:80) [sonar-batch-2.8.jar:na] at org.sonar.batch.ProjectBatch.execute(ProjectBatch.java:59) [sonar-batch-2.8.jar:na] at org.sonar.batch.Batch.analyzeModule(Batch.java:164) [sonar-batch-2.8.jar:na] at org.sonar.batch.Batch.analyzeModules(Batch.java:82) [sonar-batch-2.8.jar:na] at org.sonar.batch.Batch.execute(Batch.java:62) [sonar-batch-2.8.jar:na] at org.sonar.maven.SonarMojo.executeBatch(SonarMojo.java:155) [sonar-maven-plugin-2.8.jar:na] at org.sonar.maven.SonarMojo.execute(SonarMojo.java:144) [sonar-maven-plugin-2.8.jar:na] at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490) [maven-2.2.1-uber.jar:2.2.1] at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:98) [sonar-maven-plugin-1.0-beta-2.jar:na] at org.codehaus.mojo.sonar.Bootstraper.start(Bootstraper.java:79) [sonar-maven-plugin-1.0-beta-2.jar:na] at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:88) [sonar-maven-plugin-1.0-beta-2.jar:na] at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490) [maven-2.2.1-uber.jar:2.2.1] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694) [maven-2.2.1-uber.jar:2.2.1] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569) [maven-2.2.1-uber.jar:2.2.1] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539) [maven-2.2.1-uber.jar:2.2.1] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387) [maven-2.2.1-uber.jar:2.2.1] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:284) [maven-2.2.1-uber.jar:2.2.1] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180) [maven-2.2.1-uber.jar:2.2.1] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) [maven-2.2.1-uber.jar:2.2.1] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) [maven-2.2.1-uber.jar:2.2.1] at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) [maven-2.2.1-uber.jar:2.2.1] at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60) [maven-2.2.1-uber.jar:2.2.1] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [na:1.6.0_16] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [na:1.6.0_16] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [na:1.6.0_16] at java.lang.reflect.Method.invoke(Method.java:597) [na:1.6.0_16] at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) [classworlds-1.1.jar:1.1] at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) [classworlds-1.1.jar:1.1] at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) [classworlds-1.1.jar:1.1] at org.codehaus.classworlds.Launcher.main(Launcher.java:375) [classworlds-1.1.jar:1.1] [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Can not execute Sonar Embedded error: Got an exception - org.sonar.squid.api.AnalysisException: The source directory does not correspond to the package declaration , file : D:\CodingTest\myCode\src\main\java\com\ece\mycode\HelloWorld.java, line : 0 [INFO] ------------------------------------------------------------------------ [INFO] Trace org.apache.maven.lifecycle.LifecycleExecutionException: Can not execute Sonar at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:284) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60) 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:597) 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) Caused by: org.apache.maven.plugin.MojoExecutionException: Can not execute Sonar at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:103) at org.codehaus.mojo.sonar.Bootstraper.start(Bootstraper.java:79) at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:88) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694) ... 17 more Caused by: org.sonar.squid.api.AnalysisException: Got an exception - org.sonar.squid.api.AnalysisException: The source directory does not correspond to the package declaration , file : D:\CodingTest\myCode\src\main\java\com\ece\mycode\HelloWorld.java, line : 0 at org.sonar.java.ast.CheckstyleAuditListener.addError(CheckstyleAuditListener.java:40) at com.puppycrawl.tools.checkstyle.Checker.fireErrors(Checker.java:513) at com.puppycrawl.tools.checkstyle.Checker.process(Checker.java:279) at org.sonar.java.ast.JavaAstScanner.launchCheckstyle(JavaAstScanner.java:129) at org.sonar.java.ast.JavaAstScanner.scanFiles(JavaAstScanner.java:118) at org.sonar.plugins.squid.SquidExecutor.scanSources(SquidExecutor.java:163) at org.sonar.plugins.squid.SquidExecutor.scan(SquidExecutor.java:84) at org.sonar.plugins.squid.SquidSensor.analyzeMainSources(SquidSensor.java:78) at org.sonar.plugins.squid.SquidSensor.analyse(SquidSensor.java:62) at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:58) at org.sonar.batch.phases.Phases.execute(Phases.java:80) at org.sonar.batch.ProjectBatch.execute(ProjectBatch.java:59) at org.sonar.batch.Batch.analyzeModule(Batch.java:164) at org.sonar.batch.Batch.analyzeModules(Batch.java:82) at org.sonar.batch.Batch.execute(Batch.java:62) at org.sonar.maven.SonarMojo.executeBatch(SonarMojo.java:155) at org.sonar.maven.SonarMojo.execute(SonarMojo.java:144) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490) at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:98) ... 21 more [INFO] ------------------------------------------------------------------------ [INFO] Total time: 10 seconds [INFO] Finished at: Thu Jun 02 17:59:59 IST 2011 [INFO] Final Memory: 32M/508M [INFO] ------------------------------------------------------------------------ Finished: FAILURE

Reply | Threaded
Open this post in threaded view
|

Re: Sonar Squid Exception

Olivier Gaudin-2
Hi,

What did you set as src directory ? Where do you run the command from ?

Olivier


On Thu, Jun 2, 2011 at 2:38 PM, deepak_bisht <[hidden email]> wrote:

Hi,
i encountered the following error after upgrading Sonar form 2.6 to 2.8.
on your previous blogs i found out its regarding java source path. Please
specify me where to set that path?
like "in custom workspace" or in "execute windows batch command"?

my build result is:

[INFO] Cobertura Report generation was successful. [INFO] Execute
org.codehaus.mojo:cobertura-maven-plugin:2.5:cobertura done: 2734 ms [INFO]
Execute maven plugin cobertura-maven-plugin done: 2734 ms [INFO] Initializer
CoberturaMavenInitializer... [INFO] Initializer CoberturaMavenInitializer
done: 0 ms [INFO] Sensor AsynchronousMeasuresSensor... [INFO] Sensor
AsynchronousMeasuresSensor done: 47 ms [INFO] Sensor JavaSourceImporter...
[INFO] Sensor JavaSourceImporter done: 31 ms [INFO] Sensor SquidSensor...
[INFO] Java AST scan...
[ERROR] Squid Error occurs when analysing
:D:\CodingTest\myCode\src\main\java\com\ece\mycode\HelloWorld.java
org.sonar.squid.api.AnalysisException: The source directory does not
correspond to the package declaration at
org.sonar.java.ast.visitor.PackageVisitor.checkPhysicalDirectory(PackageVisitor.java:93)
[sonar-squid-java-plugin-2.8.jar:na] at
org.sonar.java.ast.visitor.PackageVisitor.createSourcePackage(PackageVisitor.java:75)
[sonar-squid-java-plugin-2.8.jar:na] at
org.sonar.java.ast.visitor.PackageVisitor.visitFile(PackageVisitor.java:50)
[sonar-squid-java-plugin-2.8.jar:na] at
org.sonar.java.ast.CheckstyleSquidBridge.beginTree(CheckstyleSquidBridge.java:87)
[sonar-squid-java-plugin-2.8.jar:na] at
com.puppycrawl.tools.checkstyle.TreeWalker.notifyBegin(TreeWalker.java:349)
[checkstyle-5.1.jar:5.1] at
com.puppycrawl.tools.checkstyle.TreeWalker.walk(TreeWalker.java:324)
[checkstyle-5.1.jar:5.1] at
com.puppycrawl.tools.checkstyle.TreeWalker.processFiltered(TreeWalker.java:186)
[checkstyle-5.1.jar:5.1] at
com.puppycrawl.tools.checkstyle.api.AbstractFileSetCheck.process(AbstractFileSetCheck.java:73)
[checkstyle-5.1.jar:5.1] at
com.puppycrawl.tools.checkstyle.Checker.process(Checker.java:262)
[checkstyle-5.1.jar:5.1] at
org.sonar.java.ast.JavaAstScanner.launchCheckstyle(JavaAstScanner.java:129)
[sonar-squid-java-plugin-2.8.jar:na] at
org.sonar.java.ast.JavaAstScanner.scanFiles(JavaAstScanner.java:118)
[sonar-squid-java-plugin-2.8.jar:na] at
org.sonar.plugins.squid.SquidExecutor.scanSources(SquidExecutor.java:163)
[sonar-squid-java-plugin-2.8.jar:na] at
org.sonar.plugins.squid.SquidExecutor.scan(SquidExecutor.java:84)
[sonar-squid-java-plugin-2.8.jar:na] at
org.sonar.plugins.squid.SquidSensor.analyzeMainSources(SquidSensor.java:78)
[sonar-squid-java-plugin-2.8.jar:na] at
org.sonar.plugins.squid.SquidSensor.analyse(SquidSensor.java:62)
[sonar-squid-java-plugin-2.8.jar:na] at
org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:58)
[sonar-batch-2.8.jar:na] at
org.sonar.batch.phases.Phases.execute(Phases.java:80)
[sonar-batch-2.8.jar:na] at
org.sonar.batch.ProjectBatch.execute(ProjectBatch.java:59)
[sonar-batch-2.8.jar:na] at
org.sonar.batch.Batch.analyzeModule(Batch.java:164) [sonar-batch-2.8.jar:na]
at org.sonar.batch.Batch.analyzeModules(Batch.java:82)
[sonar-batch-2.8.jar:na] at org.sonar.batch.Batch.execute(Batch.java:62)
[sonar-batch-2.8.jar:na] at
org.sonar.maven.SonarMojo.executeBatch(SonarMojo.java:155)
[sonar-maven-plugin-2.8.jar:na] at
org.sonar.maven.SonarMojo.execute(SonarMojo.java:144)
[sonar-maven-plugin-2.8.jar:na] at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
[maven-2.2.1-uber.jar:2.2.1] at
org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:98)
[sonar-maven-plugin-1.0-beta-2.jar:na] at
org.codehaus.mojo.sonar.Bootstraper.start(Bootstraper.java:79)
[sonar-maven-plugin-1.0-beta-2.jar:na] at
org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:88)
[sonar-maven-plugin-1.0-beta-2.jar:na] at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
[maven-2.2.1-uber.jar:2.2.1] at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
[maven-2.2.1-uber.jar:2.2.1] at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
[maven-2.2.1-uber.jar:2.2.1] at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
[maven-2.2.1-uber.jar:2.2.1] at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
[maven-2.2.1-uber.jar:2.2.1] at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:284)
[maven-2.2.1-uber.jar:2.2.1] at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
[maven-2.2.1-uber.jar:2.2.1] at
org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
[maven-2.2.1-uber.jar:2.2.1] at
org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
[maven-2.2.1-uber.jar:2.2.1] at
org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
[maven-2.2.1-uber.jar:2.2.1] at
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
[maven-2.2.1-uber.jar:2.2.1] at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [na:1.6.0_16] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[na:1.6.0_16] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[na:1.6.0_16] at java.lang.reflect.Method.invoke(Method.java:597)
[na:1.6.0_16] at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
[classworlds-1.1.jar:1.1] at
org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
[classworlds-1.1.jar:1.1] at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
[classworlds-1.1.jar:1.1] at
org.codehaus.classworlds.Launcher.main(Launcher.java:375)
[classworlds-1.1.jar:1.1] [INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR [INFO]
------------------------------------------------------------------------
[INFO] Can not execute Sonar Embedded error: Got an exception -
org.sonar.squid.api.AnalysisException: The source directory does not
correspond to the package declaration , file :
D:\CodingTest\myCode\src\main\java\com\ece\mycode\HelloWorld.java, line : 0
[INFO]
------------------------------------------------------------------------
[INFO] Trace org.apache.maven.lifecycle.LifecycleExecutionException: Can not
execute Sonar at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:284)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) at
org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) at
org.apache.maven.cli.MavenCli.main(MavenCli.java:362) at
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60) 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:597) 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) Caused by:
org.apache.maven.plugin.MojoExecutionException: Can not execute Sonar at
org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:103) at
org.codehaus.mojo.sonar.Bootstraper.start(Bootstraper.java:79) at
org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:88) at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
... 17 more Caused by: org.sonar.squid.api.AnalysisException: Got an
exception - org.sonar.squid.api.AnalysisException: The source directory does
not correspond to the package declaration , file :
D:\CodingTest\myCode\src\main\java\com\ece\mycode\HelloWorld.java, line : 0
at
org.sonar.java.ast.CheckstyleAuditListener.addError(CheckstyleAuditListener.java:40)
at com.puppycrawl.tools.checkstyle.Checker.fireErrors(Checker.java:513) at
com.puppycrawl.tools.checkstyle.Checker.process(Checker.java:279) at
org.sonar.java.ast.JavaAstScanner.launchCheckstyle(JavaAstScanner.java:129)
at org.sonar.java.ast.JavaAstScanner.scanFiles(JavaAstScanner.java:118) at
org.sonar.plugins.squid.SquidExecutor.scanSources(SquidExecutor.java:163) at
org.sonar.plugins.squid.SquidExecutor.scan(SquidExecutor.java:84) at
org.sonar.plugins.squid.SquidSensor.analyzeMainSources(SquidSensor.java:78)
at org.sonar.plugins.squid.SquidSensor.analyse(SquidSensor.java:62) at
org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:58) at
org.sonar.batch.phases.Phases.execute(Phases.java:80) at
org.sonar.batch.ProjectBatch.execute(ProjectBatch.java:59) at
org.sonar.batch.Batch.analyzeModule(Batch.java:164) at
org.sonar.batch.Batch.analyzeModules(Batch.java:82) at
org.sonar.batch.Batch.execute(Batch.java:62) at
org.sonar.maven.SonarMojo.executeBatch(SonarMojo.java:155) at
org.sonar.maven.SonarMojo.execute(SonarMojo.java:144) at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:98) ...
21 more [INFO]
------------------------------------------------------------------------
[INFO] Total time: 10 seconds [INFO] Finished at: Thu Jun 02 17:59:59 IST
2011 [INFO] Final Memory: 32M/508M [INFO]
------------------------------------------------------------------------
Finished: FAILURE


--
View this message in context: http://old.nabble.com/Sonar-Squid-Exception-tp31757239p31757239.html
Sent from the Sonar user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: Sonar Squid Exception

deepak_bisht
Hi Olivier,

In Hudson, these are the two places where i have set the src directory.

1. In configure--> Advanced project option --> Use custom Workspace: D:\CodingTest\myCode(this path is upto where my pom exist)

2. In configure --> Build --> execute Windows batch command: D:\CodingTest\myCode
Making any change in this path makes the build fail immediately.

i have also tried other paths e.g:
D:\CodingTest\myCode\src\main\java

The full path where my src code exist is :
D:\CodingTest\myCode\src\main\java\com\ece\mycode\HelloWorld.java

Which is the correct value for path?

Hi,

What did you set as src directory ? Where do you run the command from ?

Olivier


On Thu, Jun 2, 2011 at 2:38 PM, deepak_bisht <deepakrocks100@gmail.com>wrote:

>
> Hi,
> i encountered the following error after upgrading Sonar form 2.6 to 2.8.
> on your previous blogs i found out its regarding java source path. Please
> specify me where to set that path?
> like "in custom workspace" or in "execute windows batch command"?
>
> my build result is:
>
> [INFO] Cobertura Report generation was successful. [INFO] Execute
> org.codehaus.mojo:cobertura-maven-plugin:2.5:cobertura done: 2734 ms [INFO]
> Execute maven plugin cobertura-maven-plugin done: 2734 ms [INFO]
> Initializer
> CoberturaMavenInitializer... [INFO] Initializer CoberturaMavenInitializer
> done: 0 ms [INFO] Sensor AsynchronousMeasuresSensor... [INFO] Sensor
> AsynchronousMeasuresSensor done: 47 ms [INFO] Sensor JavaSourceImporter...
> [INFO] Sensor JavaSourceImporter done: 31 ms [INFO] Sensor SquidSensor...
> [INFO] Java AST scan...
> [ERROR] Squid Error occurs when analysing
> :D:\CodingTest\myCode\src\main\java\com\ece\mycode\HelloWorld.java
> org.sonar.squid.api.AnalysisException: The source directory does not
> correspond to the package declaration at
>
> org.sonar.java.ast.visitor.PackageVisitor.checkPhysicalDirectory(PackageVisitor.java:93)
> [sonar-squid-java-plugin-2.8.jar:na] at
>
> org.sonar.java.ast.visitor.PackageVisitor.createSourcePackage(PackageVisitor.java:75)
> [sonar-squid-java-plugin-2.8.jar:na] at
> org.sonar.java.ast.visitor.PackageVisitor.visitFile(PackageVisitor.java:50)
> [sonar-squid-java-plugin-2.8.jar:na] at
>
> org.sonar.java.ast.CheckstyleSquidBridge.beginTree(CheckstyleSquidBridge.java:87)
> [sonar-squid-java-plugin-2.8.jar:na] at
> com.puppycrawl.tools.checkstyle.TreeWalker.notifyBegin(TreeWalker.java:349)
> [checkstyle-5.1.jar:5.1] at
> com.puppycrawl.tools.checkstyle.TreeWalker.walk(TreeWalker.java:324)
> [checkstyle-5.1.jar:5.1] at
>
> com.puppycrawl.tools.checkstyle.TreeWalker.processFiltered(TreeWalker.java:186)
> [checkstyle-5.1.jar:5.1] at
>
> com.puppycrawl.tools.checkstyle.api.AbstractFileSetCheck.process(AbstractFileSetCheck.java:73)
> [checkstyle-5.1.jar:5.1] at
> com.puppycrawl.tools.checkstyle.Checker.process(Checker.java:262)
> [checkstyle-5.1.jar:5.1] at
> org.sonar.java.ast.JavaAstScanner.launchCheckstyle(JavaAstScanner.java:129)
> [sonar-squid-java-plugin-2.8.jar:na] at
> org.sonar.java.ast.JavaAstScanner.scanFiles(JavaAstScanner.java:118)
> [sonar-squid-java-plugin-2.8.jar:na] at
> org.sonar.plugins.squid.SquidExecutor.scanSources(SquidExecutor.java:163)
> [sonar-squid-java-plugin-2.8.jar:na] at
> org.sonar.plugins.squid.SquidExecutor.scan(SquidExecutor.java:84)
> [sonar-squid-java-plugin-2.8.jar:na] at
> org.sonar.plugins.squid.SquidSensor.analyzeMainSources(SquidSensor.java:78)
> [sonar-squid-java-plugin-2.8.jar:na] at
> org.sonar.plugins.squid.SquidSensor.analyse(SquidSensor.java:62)
> [sonar-squid-java-plugin-2.8.jar:na] at
> org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:58)
> [sonar-batch-2.8.jar:na] at
> org.sonar.batch.phases.Phases.execute(Phases.java:80)
> [sonar-batch-2.8.jar:na] at
> org.sonar.batch.ProjectBatch.execute(ProjectBatch.java:59)
> [sonar-batch-2.8.jar:na] at
> org.sonar.batch.Batch.analyzeModule(Batch.java:164)
> [sonar-batch-2.8.jar:na]
> at org.sonar.batch.Batch.analyzeModules(Batch.java:82)
> [sonar-batch-2.8.jar:na] at org.sonar.batch.Batch.execute(Batch.java:62)
> [sonar-batch-2.8.jar:na] at
> org.sonar.maven.SonarMojo.executeBatch(SonarMojo.java:155)
> [sonar-maven-plugin-2.8.jar:na] at
> org.sonar.maven.SonarMojo.execute(SonarMojo.java:144)
> [sonar-maven-plugin-2.8.jar:na] at
>
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
> [maven-2.2.1-uber.jar:2.2.1] at
> org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:98)
> [sonar-maven-plugin-1.0-beta-2.jar:na] at
> org.codehaus.mojo.sonar.Bootstraper.start(Bootstraper.java:79)
> [sonar-maven-plugin-1.0-beta-2.jar:na] at
> org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:88)
> [sonar-maven-plugin-1.0-beta-2.jar:na] at
>
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
> [maven-2.2.1-uber.jar:2.2.1] at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
> [maven-2.2.1-uber.jar:2.2.1] at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
> [maven-2.2.1-uber.jar:2.2.1] at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
> [maven-2.2.1-uber.jar:2.2.1] at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
> [maven-2.2.1-uber.jar:2.2.1] at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:284)
> [maven-2.2.1-uber.jar:2.2.1] at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
> [maven-2.2.1-uber.jar:2.2.1] at
> org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
> [maven-2.2.1-uber.jar:2.2.1] at
> org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
> [maven-2.2.1-uber.jar:2.2.1] at
> org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
> [maven-2.2.1-uber.jar:2.2.1] at
> org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
> [maven-2.2.1-uber.jar:2.2.1] at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [na:1.6.0_16]
> at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> [na:1.6.0_16] at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> [na:1.6.0_16] at java.lang.reflect.Method.invoke(Method.java:597)
> [na:1.6.0_16] at
> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
> [classworlds-1.1.jar:1.1] at
> org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
> [classworlds-1.1.jar:1.1] at
> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
> [classworlds-1.1.jar:1.1] at
> org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> [classworlds-1.1.jar:1.1] [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR [INFO]
> ------------------------------------------------------------------------
> [INFO] Can not execute Sonar Embedded error: Got an exception -
> org.sonar.squid.api.AnalysisException: The source directory does not
> correspond to the package declaration , file :
> D:\CodingTest\myCode\src\main\java\com\ece\mycode\HelloWorld.java, line : 0
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Trace org.apache.maven.lifecycle.LifecycleExecutionException: Can
> not
> execute Sonar at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
> at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
> at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
> at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
> at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:284)
> at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) at
> org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) at
> org.apache.maven.cli.MavenCli.main(MavenCli.java:362) at
> org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60) 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:597) 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) Caused by:
> org.apache.maven.plugin.MojoExecutionException: Can not execute Sonar at
> org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:103) at
> org.codehaus.mojo.sonar.Bootstraper.start(Bootstraper.java:79) at
> org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:88) at
>
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
> at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
> ... 17 more Caused by: org.sonar.squid.api.AnalysisException: Got an
> exception - org.sonar.squid.api.AnalysisException: The source directory
> does
> not correspond to the package declaration , file :
> D:\CodingTest\myCode\src\main\java\com\ece\mycode\HelloWorld.java, line : 0
> at
>
> org.sonar.java.ast.CheckstyleAuditListener.addError(CheckstyleAuditListener.java:40)
> at com.puppycrawl.tools.checkstyle.Checker.fireErrors(Checker.java:513) at
> com.puppycrawl.tools.checkstyle.Checker.process(Checker.java:279) at
> org.sonar.java.ast.JavaAstScanner.launchCheckstyle(JavaAstScanner.java:129)
> at org.sonar.java.ast.JavaAstScanner.scanFiles(JavaAstScanner.java:118) at
> org.sonar.plugins.squid.SquidExecutor.scanSources(SquidExecutor.java:163)
> at
> org.sonar.plugins.squid.SquidExecutor.scan(SquidExecutor.java:84) at
> org.sonar.plugins.squid.SquidSensor.analyzeMainSources(SquidSensor.java:78)
> at org.sonar.plugins.squid.SquidSensor.analyse(SquidSensor.java:62) at
> org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:58) at
> org.sonar.batch.phases.Phases.execute(Phases.java:80) at
> org.sonar.batch.ProjectBatch.execute(ProjectBatch.java:59) at
> org.sonar.batch.Batch.analyzeModule(Batch.java:164) at
> org.sonar.batch.Batch.analyzeModules(Batch.java:82) at
> org.sonar.batch.Batch.execute(Batch.java:62) at
> org.sonar.maven.SonarMojo.executeBatch(SonarMojo.java:155) at
> org.sonar.maven.SonarMojo.execute(SonarMojo.java:144) at
>
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
> at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:98) ...
> 21 more [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 10 seconds [INFO] Finished at: Thu Jun 02 17:59:59 IST
> 2011 [INFO] Final Memory: 32M/508M [INFO]
> ------------------------------------------------------------------------
> Finished: FAILURE
>
>
> --
> View this message in context:
> http://old.nabble.com/Sonar-Squid-Exception-tp31757239p31757239.html
> Sent from the Sonar user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Sonar Squid Exception

Simon Brandhof
Can you check that the package declaration in HelloWorld.java is com.ece.mycode please ?


On Fri, Jun 3, 2011 at 8:02 AM, deepak_bisht <[hidden email]> wrote:

Hi Olivier,

In Hudson, these are the two places where i have set the src directory.

1. In configure--> Advanced project option --> Use custom Workspace:
D:\CodingTest\myCode(this path is upto where my pom exist)

2. In configure --> Build --> execute Windows batch command:
D:\CodingTest\myCode
Making any change in this path makes the build fail immediately.

i have also tried other paths e.g:
D:\CodingTest\myCode\src\main\java

The full path where my src code exist is :
D:\CodingTest\myCode\src\main\java\com\ece\mycode\HelloWorld.java

Which is the correct value for path?

Hi,

What did you set as src directory ? Where do you run the command from ?

Olivier


On Thu, Jun 2, 2011 at 2:38 PM, deepak_bisht
<[hidden email]>wrote:

>
> Hi,
> i encountered the following error after upgrading Sonar form 2.6 to 2.8.
> on your previous blogs i found out its regarding java source path. Please
> specify me where to set that path?
> like "in custom workspace" or in "execute windows batch command"?
>
> my build result is:
>
> [INFO] Cobertura Report generation was successful. [INFO] Execute
> org.codehaus.mojo:cobertura-maven-plugin:2.5:cobertura done: 2734 ms
> [INFO]
> Execute maven plugin cobertura-maven-plugin done: 2734 ms [INFO]
> Initializer
> CoberturaMavenInitializer... [INFO] Initializer CoberturaMavenInitializer
> done: 0 ms [INFO] Sensor AsynchronousMeasuresSensor... [INFO] Sensor
> AsynchronousMeasuresSensor done: 47 ms [INFO] Sensor JavaSourceImporter...
> [INFO] Sensor JavaSourceImporter done: 31 ms [INFO] Sensor SquidSensor...
> [INFO] Java AST scan...
> [ERROR] Squid Error occurs when analysing
> :D:\CodingTest\myCode\src\main\java\com\ece\mycode\HelloWorld.java
> org.sonar.squid.api.AnalysisException: The source directory does not
> correspond to the package declaration at
>
> org.sonar.java.ast.visitor.PackageVisitor.checkPhysicalDirectory(PackageVisitor.java:93)
> [sonar-squid-java-plugin-2.8.jar:na] at
>
> org.sonar.java.ast.visitor.PackageVisitor.createSourcePackage(PackageVisitor.java:75)
> [sonar-squid-java-plugin-2.8.jar:na] at
> org.sonar.java.ast.visitor.PackageVisitor.visitFile(PackageVisitor.java:50)
> [sonar-squid-java-plugin-2.8.jar:na] at
>
> org.sonar.java.ast.CheckstyleSquidBridge.beginTree(CheckstyleSquidBridge.java:87)
> [sonar-squid-java-plugin-2.8.jar:na] at
> com.puppycrawl.tools.checkstyle.TreeWalker.notifyBegin(TreeWalker.java:349)
> [checkstyle-5.1.jar:5.1] at
> com.puppycrawl.tools.checkstyle.TreeWalker.walk(TreeWalker.java:324)
> [checkstyle-5.1.jar:5.1] at
>
> com.puppycrawl.tools.checkstyle.TreeWalker.processFiltered(TreeWalker.java:186)
> [checkstyle-5.1.jar:5.1] at
>
> com.puppycrawl.tools.checkstyle.api.AbstractFileSetCheck.process(AbstractFileSetCheck.java:73)
> [checkstyle-5.1.jar:5.1] at
> com.puppycrawl.tools.checkstyle.Checker.process(Checker.java:262)
> [checkstyle-5.1.jar:5.1] at
> org.sonar.java.ast.JavaAstScanner.launchCheckstyle(JavaAstScanner.java:129)
> [sonar-squid-java-plugin-2.8.jar:na] at
> org.sonar.java.ast.JavaAstScanner.scanFiles(JavaAstScanner.java:118)
> [sonar-squid-java-plugin-2.8.jar:na] at
> org.sonar.plugins.squid.SquidExecutor.scanSources(SquidExecutor.java:163)
> [sonar-squid-java-plugin-2.8.jar:na] at
> org.sonar.plugins.squid.SquidExecutor.scan(SquidExecutor.java:84)
> [sonar-squid-java-plugin-2.8.jar:na] at
> org.sonar.plugins.squid.SquidSensor.analyzeMainSources(SquidSensor.java:78)
> [sonar-squid-java-plugin-2.8.jar:na] at
> org.sonar.plugins.squid.SquidSensor.analyse(SquidSensor.java:62)
> [sonar-squid-java-plugin-2.8.jar:na] at
> org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:58)
> [sonar-batch-2.8.jar:na] at
> org.sonar.batch.phases.Phases.execute(Phases.java:80)
> [sonar-batch-2.8.jar:na] at
> org.sonar.batch.ProjectBatch.execute(ProjectBatch.java:59)
> [sonar-batch-2.8.jar:na] at
> org.sonar.batch.Batch.analyzeModule(Batch.java:164)
> [sonar-batch-2.8.jar:na]
> at org.sonar.batch.Batch.analyzeModules(Batch.java:82)
> [sonar-batch-2.8.jar:na] at org.sonar.batch.Batch.execute(Batch.java:62)
> [sonar-batch-2.8.jar:na] at
> org.sonar.maven.SonarMojo.executeBatch(SonarMojo.java:155)
> [sonar-maven-plugin-2.8.jar:na] at
> org.sonar.maven.SonarMojo.execute(SonarMojo.java:144)
> [sonar-maven-plugin-2.8.jar:na] at
>
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
> [maven-2.2.1-uber.jar:2.2.1] at
> org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:98)
> [sonar-maven-plugin-1.0-beta-2.jar:na] at
> org.codehaus.mojo.sonar.Bootstraper.start(Bootstraper.java:79)
> [sonar-maven-plugin-1.0-beta-2.jar:na] at
> org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:88)
> [sonar-maven-plugin-1.0-beta-2.jar:na] at
>
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
> [maven-2.2.1-uber.jar:2.2.1] at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
> [maven-2.2.1-uber.jar:2.2.1] at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
> [maven-2.2.1-uber.jar:2.2.1] at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
> [maven-2.2.1-uber.jar:2.2.1] at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
> [maven-2.2.1-uber.jar:2.2.1] at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:284)
> [maven-2.2.1-uber.jar:2.2.1] at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
> [maven-2.2.1-uber.jar:2.2.1] at
> org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
> [maven-2.2.1-uber.jar:2.2.1] at
> org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
> [maven-2.2.1-uber.jar:2.2.1] at
> org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
> [maven-2.2.1-uber.jar:2.2.1] at
> org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
> [maven-2.2.1-uber.jar:2.2.1] at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [na:1.6.0_16]
> at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> [na:1.6.0_16] at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> [na:1.6.0_16] at java.lang.reflect.Method.invoke(Method.java:597)
> [na:1.6.0_16] at
> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
> [classworlds-1.1.jar:1.1] at
> org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
> [classworlds-1.1.jar:1.1] at
> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
> [classworlds-1.1.jar:1.1] at
> org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> [classworlds-1.1.jar:1.1] [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR [INFO]
> ------------------------------------------------------------------------
> [INFO] Can not execute Sonar Embedded error: Got an exception -
> org.sonar.squid.api.AnalysisException: The source directory does not
> correspond to the package declaration , file :
> D:\CodingTest\myCode\src\main\java\com\ece\mycode\HelloWorld.java, line :
> 0
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Trace org.apache.maven.lifecycle.LifecycleExecutionException: Can
> not
> execute Sonar at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
> at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
> at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
> at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
> at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:284)
> at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) at
> org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) at
> org.apache.maven.cli.MavenCli.main(MavenCli.java:362) at
> org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60) 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:597) 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) Caused by:
> org.apache.maven.plugin.MojoExecutionException: Can not execute Sonar at
> org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:103) at
> org.codehaus.mojo.sonar.Bootstraper.start(Bootstraper.java:79) at
> org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:88) at
>
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
> at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
> ... 17 more Caused by: org.sonar.squid.api.AnalysisException: Got an
> exception - org.sonar.squid.api.AnalysisException: The source directory
> does
> not correspond to the package declaration , file :
> D:\CodingTest\myCode\src\main\java\com\ece\mycode\HelloWorld.java, line :
> 0
> at
>
> org.sonar.java.ast.CheckstyleAuditListener.addError(CheckstyleAuditListener.java:40)
> at com.puppycrawl.tools.checkstyle.Checker.fireErrors(Checker.java:513) at
> com.puppycrawl.tools.checkstyle.Checker.process(Checker.java:279) at
> org.sonar.java.ast.JavaAstScanner.launchCheckstyle(JavaAstScanner.java:129)
> at org.sonar.java.ast.JavaAstScanner.scanFiles(JavaAstScanner.java:118) at
> org.sonar.plugins.squid.SquidExecutor.scanSources(SquidExecutor.java:163)
> at
> org.sonar.plugins.squid.SquidExecutor.scan(SquidExecutor.java:84) at
> org.sonar.plugins.squid.SquidSensor.analyzeMainSources(SquidSensor.java:78)
> at org.sonar.plugins.squid.SquidSensor.analyse(SquidSensor.java:62) at
> org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:58) at
> org.sonar.batch.phases.Phases.execute(Phases.java:80) at
> org.sonar.batch.ProjectBatch.execute(ProjectBatch.java:59) at
> org.sonar.batch.Batch.analyzeModule(Batch.java:164) at
> org.sonar.batch.Batch.analyzeModules(Batch.java:82) at
> org.sonar.batch.Batch.execute(Batch.java:62) at
> org.sonar.maven.SonarMojo.executeBatch(SonarMojo.java:155) at
> org.sonar.maven.SonarMojo.execute(SonarMojo.java:144) at
>
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
> at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:98)
> ...
> 21 more [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 10 seconds [INFO] Finished at: Thu Jun 02 17:59:59 IST
> 2011 [INFO] Final Memory: 32M/508M [INFO]
> ------------------------------------------------------------------------
> Finished: FAILURE
>
>
> --
> View this message in context:
> http://old.nabble.com/Sonar-Squid-Exception-tp31757239p31757239.html
> Sent from the Sonar user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>



--
View this message in context: http://old.nabble.com/Sonar-Squid-Exception-tp31757239p31763134.html
Sent from the Sonar user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: Sonar Squid Exception

deepak_bisht
Hi Olivier,

Thanks a lot. the problem was in my package declaration.

Deepak

Simon Brandhof-4 wrote
Can you check that the package declaration in HelloWorld.java is
com.ece.mycode please ?


On Fri, Jun 3, 2011 at 8:02 AM, deepak_bisht <deepakrocks100@gmail.com>wrote:

>
> Hi Olivier,
>
> In Hudson, these are the two places where i have set the src directory.
>
> 1. In configure--> Advanced project option --> Use custom Workspace:
> D:\CodingTest\myCode(this path is upto where my pom exist)
>
> 2. In configure --> Build --> execute Windows batch command:
> D:\CodingTest\myCode
> Making any change in this path makes the build fail immediately.
>
> i have also tried other paths e.g:
> D:\CodingTest\myCode\src\main\java
>
> The full path where my src code exist is :
> D:\CodingTest\myCode\src\main\java\com\ece\mycode\HelloWorld.java
>
> Which is the correct value for path?
>
> Hi,
>
> What did you set as src directory ? Where do you run the command from ?
>
> Olivier
>
>
> On Thu, Jun 2, 2011 at 2:38 PM, deepak_bisht
> <deepakrocks100@gmail.com>wrote:
>
> >
> > Hi,
> > i encountered the following error after upgrading Sonar form 2.6 to 2.8.
> > on your previous blogs i found out its regarding java source path. Please
> > specify me where to set that path?
> > like "in custom workspace" or in "execute windows batch command"?
> >
> > my build result is:
> >
> > [INFO] Cobertura Report generation was successful. [INFO] Execute
> > org.codehaus.mojo:cobertura-maven-plugin:2.5:cobertura done: 2734 ms
> > [INFO]
> > Execute maven plugin cobertura-maven-plugin done: 2734 ms [INFO]
> > Initializer
> > CoberturaMavenInitializer... [INFO] Initializer CoberturaMavenInitializer
> > done: 0 ms [INFO] Sensor AsynchronousMeasuresSensor... [INFO] Sensor
> > AsynchronousMeasuresSensor done: 47 ms [INFO] Sensor
> JavaSourceImporter...
> > [INFO] Sensor JavaSourceImporter done: 31 ms [INFO] Sensor SquidSensor...
> > [INFO] Java AST scan...
> > [ERROR] Squid Error occurs when analysing
> > :D:\CodingTest\myCode\src\main\java\com\ece\mycode\HelloWorld.java
> > org.sonar.squid.api.AnalysisException: The source directory does not
> > correspond to the package declaration at
> >
> >
> org.sonar.java.ast.visitor.PackageVisitor.checkPhysicalDirectory(PackageVisitor.java:93)
> > [sonar-squid-java-plugin-2.8.jar:na] at
> >
> >
> org.sonar.java.ast.visitor.PackageVisitor.createSourcePackage(PackageVisitor.java:75)
> > [sonar-squid-java-plugin-2.8.jar:na] at
> >
> org.sonar.java.ast.visitor.PackageVisitor.visitFile(PackageVisitor.java:50)
> > [sonar-squid-java-plugin-2.8.jar:na] at
> >
> >
> org.sonar.java.ast.CheckstyleSquidBridge.beginTree(CheckstyleSquidBridge.java:87)
> > [sonar-squid-java-plugin-2.8.jar:na] at
> >
> com.puppycrawl.tools.checkstyle.TreeWalker.notifyBegin(TreeWalker.java:349)
> > [checkstyle-5.1.jar:5.1] at
> > com.puppycrawl.tools.checkstyle.TreeWalker.walk(TreeWalker.java:324)
> > [checkstyle-5.1.jar:5.1] at
> >
> >
> com.puppycrawl.tools.checkstyle.TreeWalker.processFiltered(TreeWalker.java:186)
> > [checkstyle-5.1.jar:5.1] at
> >
> >
> com.puppycrawl.tools.checkstyle.api.AbstractFileSetCheck.process(AbstractFileSetCheck.java:73)
> > [checkstyle-5.1.jar:5.1] at
> > com.puppycrawl.tools.checkstyle.Checker.process(Checker.java:262)
> > [checkstyle-5.1.jar:5.1] at
> >
> org.sonar.java.ast.JavaAstScanner.launchCheckstyle(JavaAstScanner.java:129)
> > [sonar-squid-java-plugin-2.8.jar:na] at
> > org.sonar.java.ast.JavaAstScanner.scanFiles(JavaAstScanner.java:118)
> > [sonar-squid-java-plugin-2.8.jar:na] at
> > org.sonar.plugins.squid.SquidExecutor.scanSources(SquidExecutor.java:163)
> > [sonar-squid-java-plugin-2.8.jar:na] at
> > org.sonar.plugins.squid.SquidExecutor.scan(SquidExecutor.java:84)
> > [sonar-squid-java-plugin-2.8.jar:na] at
> >
> org.sonar.plugins.squid.SquidSensor.analyzeMainSources(SquidSensor.java:78)
> > [sonar-squid-java-plugin-2.8.jar:na] at
> > org.sonar.plugins.squid.SquidSensor.analyse(SquidSensor.java:62)
> > [sonar-squid-java-plugin-2.8.jar:na] at
> > org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:58)
> > [sonar-batch-2.8.jar:na] at
> > org.sonar.batch.phases.Phases.execute(Phases.java:80)
> > [sonar-batch-2.8.jar:na] at
> > org.sonar.batch.ProjectBatch.execute(ProjectBatch.java:59)
> > [sonar-batch-2.8.jar:na] at
> > org.sonar.batch.Batch.analyzeModule(Batch.java:164)
> > [sonar-batch-2.8.jar:na]
> > at org.sonar.batch.Batch.analyzeModules(Batch.java:82)
> > [sonar-batch-2.8.jar:na] at org.sonar.batch.Batch.execute(Batch.java:62)
> > [sonar-batch-2.8.jar:na] at
> > org.sonar.maven.SonarMojo.executeBatch(SonarMojo.java:155)
> > [sonar-maven-plugin-2.8.jar:na] at
> > org.sonar.maven.SonarMojo.execute(SonarMojo.java:144)
> > [sonar-maven-plugin-2.8.jar:na] at
> >
> >
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
> > [maven-2.2.1-uber.jar:2.2.1] at
> > org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:98)
> > [sonar-maven-plugin-1.0-beta-2.jar:na] at
> > org.codehaus.mojo.sonar.Bootstraper.start(Bootstraper.java:79)
> > [sonar-maven-plugin-1.0-beta-2.jar:na] at
> > org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:88)
> > [sonar-maven-plugin-1.0-beta-2.jar:na] at
> >
> >
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
> > [maven-2.2.1-uber.jar:2.2.1] at
> >
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
> > [maven-2.2.1-uber.jar:2.2.1] at
> >
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
> > [maven-2.2.1-uber.jar:2.2.1] at
> >
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
> > [maven-2.2.1-uber.jar:2.2.1] at
> >
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
> > [maven-2.2.1-uber.jar:2.2.1] at
> >
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:284)
> > [maven-2.2.1-uber.jar:2.2.1] at
> >
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
> > [maven-2.2.1-uber.jar:2.2.1] at
> > org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
> > [maven-2.2.1-uber.jar:2.2.1] at
> > org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
> > [maven-2.2.1-uber.jar:2.2.1] at
> > org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
> > [maven-2.2.1-uber.jar:2.2.1] at
> > org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
> > [maven-2.2.1-uber.jar:2.2.1] at
> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [na:1.6.0_16]
> > at
> >
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> > [na:1.6.0_16] at
> >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> > [na:1.6.0_16] at java.lang.reflect.Method.invoke(Method.java:597)
> > [na:1.6.0_16] at
> > org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
> > [classworlds-1.1.jar:1.1] at
> > org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
> > [classworlds-1.1.jar:1.1] at
> > org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
> > [classworlds-1.1.jar:1.1] at
> > org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> > [classworlds-1.1.jar:1.1] [INFO]
> > ------------------------------------------------------------------------
> > [ERROR] BUILD ERROR [INFO]
> > ------------------------------------------------------------------------
> > [INFO] Can not execute Sonar Embedded error: Got an exception -
> > org.sonar.squid.api.AnalysisException: The source directory does not
> > correspond to the package declaration , file :
> > D:\CodingTest\myCode\src\main\java\com\ece\mycode\HelloWorld.java, line :
> > 0
> > [INFO]
> > ------------------------------------------------------------------------
> > [INFO] Trace org.apache.maven.lifecycle.LifecycleExecutionException: Can
> > not
> > execute Sonar at
> >
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
> > at
> >
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
> > at
> >
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
> > at
> >
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
> > at
> >
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:284)
> > at
> >
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
> > at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) at
> > org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) at
> > org.apache.maven.cli.MavenCli.main(MavenCli.java:362) at
> > org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
> 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:597) 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) Caused by:
> > org.apache.maven.plugin.MojoExecutionException: Can not execute Sonar at
> > org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:103) at
> > org.codehaus.mojo.sonar.Bootstraper.start(Bootstraper.java:79) at
> > org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:88) at
> >
> >
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
> > at
> >
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
> > ... 17 more Caused by: org.sonar.squid.api.AnalysisException: Got an
> > exception - org.sonar.squid.api.AnalysisException: The source directory
> > does
> > not correspond to the package declaration , file :
> > D:\CodingTest\myCode\src\main\java\com\ece\mycode\HelloWorld.java, line :
> > 0
> > at
> >
> >
> org.sonar.java.ast.CheckstyleAuditListener.addError(CheckstyleAuditListener.java:40)
> > at com.puppycrawl.tools.checkstyle.Checker.fireErrors(Checker.java:513)
> at
> > com.puppycrawl.tools.checkstyle.Checker.process(Checker.java:279) at
> >
> org.sonar.java.ast.JavaAstScanner.launchCheckstyle(JavaAstScanner.java:129)
> > at org.sonar.java.ast.JavaAstScanner.scanFiles(JavaAstScanner.java:118)
> at
> > org.sonar.plugins.squid.SquidExecutor.scanSources(SquidExecutor.java:163)
> > at
> > org.sonar.plugins.squid.SquidExecutor.scan(SquidExecutor.java:84) at
> >
> org.sonar.plugins.squid.SquidSensor.analyzeMainSources(SquidSensor.java:78)
> > at org.sonar.plugins.squid.SquidSensor.analyse(SquidSensor.java:62) at
> > org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:58)
> at
> > org.sonar.batch.phases.Phases.execute(Phases.java:80) at
> > org.sonar.batch.ProjectBatch.execute(ProjectBatch.java:59) at
> > org.sonar.batch.Batch.analyzeModule(Batch.java:164) at
> > org.sonar.batch.Batch.analyzeModules(Batch.java:82) at
> > org.sonar.batch.Batch.execute(Batch.java:62) at
> > org.sonar.maven.SonarMojo.executeBatch(SonarMojo.java:155) at
> > org.sonar.maven.SonarMojo.execute(SonarMojo.java:144) at
> >
> >
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
> > at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:98)
> > ...
> > 21 more [INFO]
> > ------------------------------------------------------------------------
> > [INFO] Total time: 10 seconds [INFO] Finished at: Thu Jun 02 17:59:59 IST
> > 2011 [INFO] Final Memory: 32M/508M [INFO]
> > ------------------------------------------------------------------------
> > Finished: FAILURE
> >
> >
> > --
> > View this message in context:
> > http://old.nabble.com/Sonar-Squid-Exception-tp31757239p31757239.html
> > Sent from the Sonar user mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe from this list, please visit:
> >
> >    http://xircles.codehaus.org/manage_email
> >
> >
> >
>
>
>
> --
> View this message in context:
> http://old.nabble.com/Sonar-Squid-Exception-tp31757239p31763134.html
> Sent from the Sonar user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>