title: correctly setting sonar.sources in jenkins plugin
body: <p>I am trying to build an <strong>Android java project</strong> branch: feature-Fprototype_app</p>
  
  <p>I am getting this error:</p>
  
  <pre><code>[INFO] [13:38:36.470] Base dir: /Users/Shared/Jenkins/Home/jobs/Textify/workspace/mobile 
  [INFO] [13:38:36.470] Working dir: /Users/Shared/Jenkins/Home/jobs/Textify/workspace/mobile/target/sonar 
  [INFO] [13:38:36.470] Source dirs: /Users/Shared/Jenkins/Home/jobs/Textify/workspace/mobile/src 
  [INFO] [13:38:36.470] Binary dirs: /Users/Shared/Jenkins/Home/jobs/Textify/workspace/mobile/target/classes 
  [INFO] [13:38:36.470] Source encoding: UTF-8, default locale: en_US 
  [INFO] [13:38:36.489] Sensor JavaSourceImporter... 
  [INFO] [13:38:36.710] Sensor JavaSourceImporter done: 221 ms 
  [INFO] [13:38:36.710] Sensor JavaSquidSensor... 
  [INFO] [13:38:36.800] Java AST scan... 
  [ERROR] Sonar is unable to analyze file : '/Users/Shared/Jenkins/Home/jobs/Textify/workspace/mobile/src/main/java/com/simpragma/apps/textify/db/BookmarkDao.java' 
  [INFO]
      ------------------------------------------------------------------------ 
  [INFO] BUILD FAILURE 
  [INFO] ------------------- 
  [INFO] Total time:14.245s 
  [INFO] Finished at: Thu Oct 17 13:38:36 GMT+05:30 2013 
  [INFO] Final Memory: 14M/102M 
  [INFO]
      ------------------------------------------------------------------------ 
  [ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.1:sonar (default-cli) on project Textify: Can not execute SonarQube analysis: Sonar is unable to analyze file :
  
      **'/Users/Shared/Jenkins/Home/jobs/Textify/workspace/mobile/src/main/java/com/simpragma/apps/textify/db/BookmarkDao.java': The source directory does not correspond to the package declaration** com.simpragma.apps.textify.db -&gt; 
  [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.1:sonar (default-cli) on project Textify: Can not execute SonarQube analysis
  </code></pre>
  
  <p>In jenkins configuration <strong>Post Build Action</strong> I am trying to set the <code>sonar.sources</code> in <strong>Additional properties</strong> box (because when i googled for the error, people suggested to set the correct path for sources). I tried many combinations like:</p>
  
  <pre><code> -Dsonar.sources=mobile/src/main/java
   -Dsonar.sources=/Users/Shared/Jenkins/Home/jobs/Textify/workspace/mobile/src/main/java
   -Dsonar.sources=/Users/Shared/Jenkins/Home/jobs/Textify/workspace/mobile
  </code></pre>
  
  <p>still same error.
  What am I doing wrong ?</p>
  
  <p><strong>ok let me clear the mess I have created.</strong> Firstly, it is an android maven project. The package structure is com.xyz.abc and source root was src/main/java. In pom.xml the <strong>sourceDirectory</strong> property was initially set to point to <strong>src</strong>. It seems maven does not have any issue with the root of source, it is compiling the project.
  Then, I set up jenkins and sonar for this project. I used Jenkins's <strong>Post-build Action</strong> to set up Sonar analysis on my project. The catch here is "When running an analysis with Maven, some SonarQube properties are always ignored because SonarQube internally feeds them from the POM" - <a href="http://jira.codehaus.org/browse/SONAR-4536" rel="nofollow">SONAR-4536</a>. One among such properties is <strong>sonar.sources</strong> . Therefore, when i tried with -Dsonar.sources in the Jenkins setup it did not worked.
  Later I modified my pom to point to src/main/java which resulted in successful analysis through jenkins post-build action.</p>
  
  <p>I hope I have clarified.</p>