| Info | ||||
|---|---|---|---|---|
| ||||
|
Source Tree Directory
The source directory tree has to match the package declarations.
For example, the following class:
| Code Block | ||||||
|---|---|---|---|---|---|---|
| ||||||
package com.mycompany.mypackage;
... |
should be located in the following directory: [myBaseDir]/com/mycompany/mypackage/MyClass.java.
Otherwise you would get such an error while running your analysis:
| Code Block | ||||
|---|---|---|---|---|
| ||||
Exception in thread "main" org.sonar.batch.bootstrapper.BootstrapException: org.sonar.squid.api.AnalysisException: Got an exception - org.so
nar.squid.api.AnalysisException: The source directory does not correspond to the package declaration com.mycompany.mypackage, file : ..\src\MyClass.java
... |
Analyzing with Maven
What is the difference between org.codehaus.mojo:sonar-maven-plugin and org.codehaus.sonar:sonar-maven-plugin?
...
Error resolving version for 'org.codehaus.mojo:sonar-maven-plugin': Plugin requires Maven version 3.0
...
The plugin 'org.apache.maven.plugins:maven-sonar-plugin' does not exist or no valid version could be found
If you get this error message after launching the maven command line "mvn sonar:sonar" add the "-U" parameter to the command line. Maven will then update its local repository with the latest version of the Sonar Maven plugin.
...

