title: my configuration of scala-maven-plugin with multi-module project doesn't let me do 'mvn compile' in a sub directory
body: <p>We are using the  scala-maven-plugin for our mixed Java/Scala project. Works nicely in general, but we have found that with a multi-module project we can't figure out how to do a'mvn compile' in a subdirectory.</p>
  
  <p>I am unable to post my full source code to IP restrictions, but in my search for other projects that might 
  have solved this issue I only managed to come up with other projects with the exact same problem.  Here is one
  for example: <a href="https://github.com/buildlackey/scala-multimodule-sample-project.git" rel="nofollow">https://github.com/buildlackey/scala-multimodule-sample-project.git</a></p>
  
  <p>The above project has three submodules beneath the directory that holds the root pom.xml: <em>cats</em>,  <em>dogs</em> and <em>web-application</em>.
  If you git clone the above url, then  cd to 'scala-multimodule-sample-project', you will see it build.
  Now if I cd into the sub-module 'dogs' and do  a 'mvn compile', I see the message:</p>
  
  <pre><code>[INFO] No sources to compile
  </code></pre>
  
  <p>But there are sources to compile !  The plugin is just not finding them.</p>
  
  <p>This is the same thing that happens on my multi-module project.  I can't post the whole source for our stuff.. But here
  is the relevant configuration from our top level pom.xml :</p>
  
  <pre><code>&lt;build&gt;
      &lt;sourceDirectory&gt;${basedir}/src/main/scala&lt;/sourceDirectory&gt;
      &lt;testSourceDirectory&gt;${basedir}/src/test/scala&lt;/testSourceDirectory&gt;
  
    &lt;!-- Compiling scala code --&gt;
          &lt;plugin&gt;
            &lt;!-- see http://davidb.github.com/scala-maven-plugin --&gt;
            &lt;groupId&gt;net.alchim31.maven&lt;/groupId&gt;
        &lt;artifactId&gt;scala-maven-plugin&lt;/artifactId&gt;
        &lt;version&gt;3.2.2&lt;/version&gt;
        &lt;executions&gt;
          &lt;execution&gt;
            &lt;id&gt;scala-compile&lt;/id&gt;
            &lt;phase&gt;process-resources&lt;/phase&gt;
            &lt;goals&gt;
              &lt;goal&gt;add-source&lt;/goal&gt;
              &lt;goal&gt;compile&lt;/goal&gt;
            &lt;/goals&gt;
          &lt;/execution&gt;
          &lt;execution&gt;
            &lt;id&gt;scala-test-compile&lt;/id&gt;
            &lt;phase&gt;process-test-resources&lt;/phase&gt;
            &lt;goals&gt;
              &lt;goal&gt;testCompile&lt;/goal&gt;
            &lt;/goals&gt;
          &lt;/execution&gt;
        &lt;/executions&gt;
      &lt;/plugin&gt;
  </code></pre>
  
  <p>According to the documentation  for the plug-in (<a href="http://davidb.github.io/scala-maven-plugin/add-source-mojo.html" rel="nofollow">http://davidb.github.io/scala-maven-plugin/add-source-mojo.html</a>) 
  there are are optional parameters that can be passed to the add-source goal: namely, <em>sourceDir</em> and <em>testSourceDir</em>    </p>
  
  <p>However, I could not figure out how to pass these. Maybe those parameters are the key to success here ? </p>
  
  <p>Finally, one kind of silly work-around that proved successful is to copy the same configuration for scala-maven-plugin into each submodule directory where I want to  do a compile restricted to that submodule. Obviously this is a non-DRY, undesirable approach.</p>
  
  <p>I'd  be most grateful if anyone could suggest a good solution.</p>
  
  <p>Thanks !</p>