title: Can you define both an exec and java goal for maven exec plugin?
body: <p>I'm trying to do a couple tasks with the maven exec plugin.  One is to run a script to generate some external data that the app will use.  The second is to run a chunk of java code to do some convenience work during the compile phase.</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;data_for_app&lt;/id&gt;
          &lt;phase&gt;generate-sources&lt;/phase&gt;
          &lt;goals&gt;
              &lt;goal&gt;exec&lt;/goal&gt;
          &lt;/goals&gt;
          &lt;configuration&gt;
              &lt;executable&gt;${basedir}/scripts/getappdata.sh&lt;/executable&gt;
              &lt;arguments&gt;
                  &lt;argument&gt;${basedir}/src/main/webapp/WEB-INF/xml/appdatahere/&lt;/argument&gt;
              &lt;/arguments&gt;
          &lt;/configuration&gt;
      &lt;/execution&gt;
      &lt;execution&gt;
          &lt;id&gt;do_convenience&lt;/id&gt;
          &lt;phase&gt;compile&lt;/phase&gt;
          &lt;goals&gt;
              &lt;goal&gt;java&lt;/goal&gt;
          &lt;/goals&gt;
          &lt;configuration&gt;
              &lt;mainClass&gt;com.example.DoConvenienceStuff&lt;/mainClass&gt;
              &lt;arguments&gt;
                  &lt;argument&gt;https://example.com/data&lt;/argument&gt;
              &lt;/arguments&gt;
          &lt;/configuration&gt;
      &lt;/execution&gt;
  &lt;/executions&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>But when I run:</p>
  
  <pre><code>mvn clean package exec:exec
  </code></pre>
  
  <p>I get the error:</p>
  
  <pre><code>[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project jss: The parameters 'executable' for goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec are missing or invalid -&gt; [Help 1]
  </code></pre>
  
  <p>Or a similar error saying the parameter 'mainClass' is missing or invalid.</p>