| Info |
|---|
| icon | false |
|---|
| title | Table of Contents |
|---|
|
|
Source Tree Directory
The source directory tree has to match the package declarations.
For example, the following class:
| Code Block |
|---|
| title | MyClass.java |
|---|
| linenumbers | true |
|---|
| language | java |
|---|
|
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?
...