Squid Error occurs when analysing, Sonar 2.8

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

Squid Error occurs when analysing, Sonar 2.8

Jakub Glapa
Hi,
I have a little problem with Sonar 2.8. During the analysis I'm
getting an error like that:
....
[INFO]  Sensor JavaSourceImporter...
[INFO]  Sensor JavaSourceImporter done: 23 ms
[INFO]  Sensor SquidSensor...
[INFO]  Java AST scan...
[ERROR]  Squid Error occurs when analysing
:/home/jglapa/.jenkins/jobs/proj/workspace/apps/bp/rs/feat/src/a/b/c/e/f/classname.java
org.sonar.squid.api.AnalysisException: The package declaration
a.b.c.d.e.f does not correspond to the file path
a/b/c/e/f/classname.java
        at org.sonar.java.ast.visitor.PackageVisitor.checkPhysicalDirectory(PackageVisitor.java:95)
[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]
....


So I see that I have a problem with package name, but should the whole
analysis be stopped by that?
Is there a way to disable that check?

--
regards,
pozdrawiam,
Jakub Glapa

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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Squid Error occurs when analysing, Sonar 2.8

Freddy Mallet SonarSource
Hi Jakub,

Looks like the java source directory you have defined is not exactly the package root directory.

For instance /src instead of /src/java

Sonar 2.8 throws an exception to prevent any unexpected behavior, see http://jira.codehaus.org/browse/SONAR-791.

Kind regards,
Freddy

----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------


On Fri, May 27, 2011 at 1:09 PM, Jakub Glapa <[hidden email]> wrote:
Hi,
I have a little problem with Sonar 2.8. During the analysis I'm
getting an error like that:
....
[INFO]  Sensor JavaSourceImporter...
[INFO]  Sensor JavaSourceImporter done: 23 ms
[INFO]  Sensor SquidSensor...
[INFO]  Java AST scan...
[ERROR]  Squid Error occurs when analysing
:/home/jglapa/.jenkins/jobs/proj/workspace/apps/bp/rs/feat/src/a/b/c/e/f/classname.java
org.sonar.squid.api.AnalysisException: The package declaration
a.b.c.d.e.f does not correspond to the file path
a/b/c/e/f/classname.java
       at org.sonar.java.ast.visitor.PackageVisitor.checkPhysicalDirectory(PackageVisitor.java:95)
[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]
....


So I see that I have a problem with package name, but should the whole
analysis be stopped by that?
Is there a way to disable that check?

--
regards,
pozdrawiam,
Jakub Glapa

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

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: Squid Error occurs when analysing, Sonar 2.8

Jakub Glapa
Yep that sound reasonable now, thanks!

--
regards,
pozdrawiam,
Jakub Glapa



On Tue, May 31, 2011 at 8:13 AM, Freddy Mallet
<[hidden email]> wrote:

> Hi Jakub,
> Looks like the java source directory you have defined is not exactly the
> package root directory.
> For instance /src instead of /src/java
> Sonar 2.8 throws an exception to prevent any unexpected behavior,
> see http://jira.codehaus.org/browse/SONAR-791.
> Kind regards,
> Freddy
> ----------------------------------------
> Freddy Mallet
> www.SonarSource.org
> www.SonarSource.com
> ----------------------------------------
>
>
> On Fri, May 27, 2011 at 1:09 PM, Jakub Glapa <[hidden email]> wrote:
>>
>> Hi,
>> I have a little problem with Sonar 2.8. During the analysis I'm
>> getting an error like that:
>> ....
>> [INFO]  Sensor JavaSourceImporter...
>> [INFO]  Sensor JavaSourceImporter done: 23 ms
>> [INFO]  Sensor SquidSensor...
>> [INFO]  Java AST scan...
>> [ERROR]  Squid Error occurs when analysing
>>
>> :/home/jglapa/.jenkins/jobs/proj/workspace/apps/bp/rs/feat/src/a/b/c/e/f/classname.java
>> org.sonar.squid.api.AnalysisException: The package declaration
>> a.b.c.d.e.f does not correspond to the file path
>> a/b/c/e/f/classname.java
>>        at
>> org.sonar.java.ast.visitor.PackageVisitor.checkPhysicalDirectory(PackageVisitor.java:95)
>> [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]
>> ....
>>
>>
>> So I see that I have a problem with package name, but should the whole
>> analysis be stopped by that?
>> Is there a way to disable that check?
>>
>> --
>> regards,
>> pozdrawiam,
>> Jakub Glapa
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>
>

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

    http://xircles.codehaus.org/manage_email