title: How to use Sonar Runner on selected files?
body: <p>I want to run Sonar Runner only on some selected files only. I'm using SonarRunner Ant.</p>
  
  <p>My project directory structure is :</p>
  
  <pre><code>MyProject
   |
   |-----src
          |-----java
                 |-----A
                       |-----B
                       |     |---&lt;files&gt;.java
                       |
                       |-----C
                       |     |---&lt;files&gt;.java
                       |
                       |-----hello.java
  </code></pre>
  
  <p>Now I want to run Sonar Runner only on <em>hello.java</em> file. </p>
  
  <pre><code>sonar.sources=../../../MyProject/src      // takes the source directory
  
  sonar.sources=../../../MyProject/src/java/A/hello.java    didn't work
  
  sonar.exclusions=**/**/*.java            // excludes all java files
  
  // now I want to include only hello.java file
  // didn't find any parameter for inclusion, but tried the following
  
  sonar.inclusions=hello.java             // didn't work
  sonar.inclusions=java/A/hello.java      // didn't work
  </code></pre>
  
  <p><a href="http://docs.codehaus.org/display/SONAR/Analysis+Parameters" rel="nofollow">Referred this article</a> for analysis parameters.</p>
  
  <p>One solution which crossed my mind is : exclusion of all the files but the required ones. </p>
  
  <p>But here the structure is just a small part. In real I have more than 250 java files, and want to generate report for, say, 10 files only. Then, by this approach, excluding 240+ files doesn't look a good idea.</p>
  
  <p>Is there anyway to generate sonar report on selected files, other than the mentioned approach?</p>