title: Are there any ways to generate Scala code from Protobuf files in a Maven build?
body: <p>I'm looking for a solution that includes all 3 of these things.  Thus far, I've been able to find Maven plugins that will generate Java code from proto files during a build, and command line tools that will generate Scala code from proto files, but nothing that mixes everything together.</p>
  
  <p>The most promising thing I've found so far is ScalaBuff, and the fact that it exists in the Maven repos.  If I add it as a dependency thusly...</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;net.sandrogrzicic&lt;/groupId&gt;
          &lt;artifactId&gt;scalabuff-compiler_2.10&lt;/artifactId&gt;
          &lt;version&gt;1.3.6&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;net.sandrogrzicic&lt;/groupId&gt;
          &lt;artifactId&gt;scalabuff-runtime_2.10&lt;/artifactId&gt;
          &lt;version&gt;1.3.6&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>...is there any way to simply have the Maven build launch it as a command line util during a phase of the build?  (hopefully generate-sources)  I also found this, but am at a loss as to how to get these to play nicely together: Maven: <a href="http://mojo.codehaus.org/exec-maven-plugin/" rel="nofollow noreferrer">http://mojo.codehaus.org/exec-maven-plugin/</a></p>
  
  <p>Note: I'd really like this to be portable and not depend on something installed on my local box, but hacks are perfectly welcome (i.e. adding a jar or executable to source control)</p>
  
  <p>Thanks in advance!</p>
  
  <p>UPDATE:</p>
  
  <p>In addition to the above dependency, if I add the following...</p>
  
  <pre><code>    &lt;plugin&gt;
          &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
          &lt;artifactId&gt;exec-maven-plugin&lt;/artifactId&gt;
          &lt;version&gt;1.2.1&lt;/version&gt;
          &lt;executions&gt;
              &lt;execution&gt;
                  &lt;id&gt;protobuf-sources&lt;/id&gt;
                  &lt;phase&gt;generate-sources&lt;/phase&gt;
                  &lt;goals&gt;
                      &lt;goal&gt;java&lt;/goal&gt;
                  &lt;/goals&gt;
              &lt;/execution&gt;
          &lt;/executions&gt;
          &lt;configuration&gt;
              &lt;mainClass&gt;net.sandrogrzicic.scalabuff.compiler.ScalaBuff&lt;/mainClass&gt;
              &lt;arguments&gt;
                  &lt;argument&gt;--proto_path=src/main/protobuf&lt;/argument&gt;
                  &lt;argument&gt;--scala_out=target/generated-sources/scalabuff&lt;/argument&gt;
              &lt;/arguments&gt;
              &lt;sourceRoot&gt;target/generated-sources/scalabuff&lt;/sourceRoot&gt;
          &lt;/configuration&gt;
      &lt;/plugin&gt;
  </code></pre>
  
  <p>...I can generate source during my build (in the generate-sources phase), but the build halts immediately after running the exec plugin for some reason.  So close!  If anyone can fix that last problem, this will be solved.</p>