title: Avoid Eclipse ignore garbage in Scala Maven project
body: <p>the only way I've found to have maven compile scala sources on the command line using <code>mvn</code> is to add the executions explicitly in the <code>scala-maven-plugin</code>.</p>
  <pre><code>  &lt;plugin&gt;
      &lt;groupId&gt;net.alchim31.maven&lt;/groupId&gt;
      &lt;artifactId&gt;scala-maven-plugin&lt;/artifactId&gt;
      &lt;version&gt;3.0.1&lt;/version&gt;
      &lt;executions&gt;
        &lt;execution&gt;
          &lt;goals&gt;
            &lt;goal&gt;compile&lt;/goal&gt;
            &lt;goal&gt;testCompile&lt;/goal&gt;
          &lt;/goals&gt;
        &lt;/execution&gt;
      &lt;/executions&gt;
      &lt;configuration&gt;
        &lt;args&gt;
          &lt;arg&gt;-deprecation&lt;/arg&gt;
          &lt;arg&gt;-unchecked&lt;/arg&gt;
        &lt;/args&gt;
        &lt;jvmArgs&gt;
          &lt;jvmArg&gt;-Xms128m&lt;/jvmArg&gt;
          &lt;jvmArg&gt;-Xmx1024m&lt;/jvmArg&gt;
        &lt;/jvmArgs&gt;
      &lt;/configuration&gt;
    &lt;/plugin&gt;
  </code></pre>
  <p>However, Eclipse does not like these executions and gives the following errors.</p>
  <blockquote>
  <p>Plugin execution not covered by lifecycle configuration: net.alchim31.maven:scala-maven-plugin:3.0.1:compile (execution: default, phase: compile)</p>
  <p>Plugin execution not covered by lifecycle configuration: net.alchim31.maven:scala-maven-plugin:3.0.1:testCompile (execution: default, phase: test-compile)</p>
  </blockquote>
  <p>Eclipse suggests permanently marking the goals as ignored, but this means a lot of ugly garbage is added to my pom.  I mean, XML is already hard to look at.  Is there a better way to configure my project to compile the sources with <code>mvn</code>?  Following is what Eclipse adds.</p>
  <pre><code>&lt;pluginManagement&gt;
          &lt;plugins&gt;
              &lt;!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.--&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.eclipse.m2e&lt;/groupId&gt;
                  &lt;artifactId&gt;lifecycle-mapping&lt;/artifactId&gt;
                  &lt;version&gt;1.0.0&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;lifecycleMappingMetadata&gt;
                          &lt;pluginExecutions&gt;
                              &lt;pluginExecution&gt;
                                  &lt;pluginExecutionFilter&gt;
                                      &lt;groupId&gt;
                                          net.alchim31.maven
                                      &lt;/groupId&gt;
                                      &lt;artifactId&gt;
                                          scala-maven-plugin
                                      &lt;/artifactId&gt;
                                      &lt;versionRange&gt;
                                          [3.0.1,)
                                      &lt;/versionRange&gt;
                                      &lt;goals&gt;
                                          &lt;goal&gt;testCompile&lt;/goal&gt;
                                          &lt;goal&gt;compile&lt;/goal&gt;
                                      &lt;/goals&gt;
                                  &lt;/pluginExecutionFilter&gt;
                                  &lt;action&gt;
                                      &lt;ignore&gt;&lt;/ignore&gt;
                                  &lt;/action&gt;
                              &lt;/pluginExecution&gt;
                          &lt;/pluginExecutions&gt;
                      &lt;/lifecycleMappingMetadata&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/pluginManagement&gt;
  </code></pre>