score:1

Accepted answer

the incremental compiler in eclipse (ecj, used by the jdt) totally overrides the compiler used by command line maven builds. any maven-compiler-plugin or javac issue should be discarded as irrelevant. i would expect m2e/maven to have no significant impact on a single project workspace, as big as it is. obviously since you're seeing the opposite behavior, something is apparently slowing down the maven builder.

since you use jsp and js files, my guess this is a war project. if you're using the eclipse java ee distribution, one thing you can try is to disable the m2e-wtp integration, see if it makes any difference. go to preferences > maven > java ee integration and uncheck enable java ee configuration.

if that doesn't help (or doesn't apply to your set up), another thing you could try would be to disable maven resource processing during incremental builds. in your pom.xml, try adding:

    <profiles>
  <profile>
    <id>m2e</id>
    <!-- this profile is only activated when building in eclipse with m2e -->
    <activation>
      <property>
        <name>m2e.version</name>
      </property>
    </activation>
    <build>
      <pluginmanagement>
        <plugins>
          <!--this plugin's configuration is used to store eclipse m2e settings 
            only. it has no influence on the maven build itself. -->
          <plugin>
            <groupid>org.eclipse.m2e</groupid>
            <artifactid>lifecycle-mapping</artifactid>
            <version>1.0.0</version>
            <configuration>
              <lifecyclemappingmetadata>
                <pluginexecutions>
                  <pluginexecution>
                    <pluginexecutionfilter>
                      <groupid>
                        org.apache.maven.plugins
                      </groupid>
                      <artifactid>
                        maven-resources-plugin
                      </artifactid>
                      <versionrange>
                        [1.0,)
                      </versionrange>
                      <goals>
                        <goal>resources</goal>
                        <goal>testresources</goal>
                      </goals>
                    </pluginexecutionfilter>
                    <action>
                      <ignore></ignore>
                    </action>
                  </pluginexecution>
                </pluginexecutions>
              </lifecyclemappingmetadata>
            </configuration>
          </plugin>
        </plugins>
      </pluginmanagement>
    </build>
  </profile>
</profiles>

there's a chance it might break something else, but at least that should help determine whether resource processing is the culprit here.

anything else will require a deeper analysis, i suggest you open a ticket to https://bugs.eclipse.org/bugs/enter_bug.cgi?product=m2e

score:0

disable automatic build is the only option you have. just build when you are interested in the artifacts.

you did not say what goals you are calling maven with. maybe it would already be enough if you do not run all tests using -dskiptests (or even not compile them by using -dmaven.test.skip=true), or if not willing to skip those introduce profiles to run just the necessary tests.

since you are telling it's a legacy project i suspect that changing the project structure into a multi-module maven project is out of scope. you can then try if you can speed up using parallel builds (using -t 4 (4 threads) or -t 2c (2 threads per core).


Related Query

More Query from same tag