title: Compiling only selected files in Maven
body: <p>I want to compile only selected files or directories (including subdirectories) within source directory. I was pretty sure I can do this using <code>&lt;includes&gt;</code> of <code>maven-compiler-plugin</code>'s configuration, but it seems to not work as I expect since it still compiles all classes into <code>target/classes</code>. What is really strange, Maven output suggest that the setting actually does its work, because with:</p>
  
  <pre class="lang-xml prettyprint-override"><code>  &lt;plugin&gt;
      &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
      &lt;version&gt;2.5.1&lt;/version&gt;
      &lt;configuration&gt;
        &lt;includes&gt;
          &lt;include&gt;com/example/dao/bean/*.java&lt;/include&gt;
        &lt;/includes&gt;
      &lt;/configuration&gt;
    &lt;/plugin&gt;
  </code></pre>
  
  <p>I have:</p>
  
  <pre><code>[INFO] Compiling 1 source file to c:\Projects\test\target\classes
  </code></pre>
  
  <p>but with no compiler's configuration I have:</p>
  
  <pre><code>[INFO] Compiling 14 source file to c:\Projects\test\target\classes
  </code></pre>
  
  <p>In both cases however, all 14 classes are compiled into <code>target/classes</code> as I mentioned. Can you explain that or suggest another solution to compile only selected files?</p>