Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info
iconfalse
titleTable of Contents
Table of Contents

Source Tree Directory

The source directory tree has to match the package declarations.

For example, the following class:

Code Block
titleMyClass.java
linenumberstrue
languagejava
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
titleLog
languagenone
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?

...