davidB / scala-maven-plugin

The scala-maven-plugin (previously maven-scala-plugin) is used for compiling/testing/running/documenting scala code in maven.
https://davidb.github.io/scala-maven-plugin/
The Unlicense
554 stars 150 forks source link

Improve performance of multimodule build by reusing compiler objects #720

Open micossow opened 11 months ago

micossow commented 11 months ago

Hi,

We're using the scala-maven-plugin for one of our projects having multiple maven modules with scala code. We observed, that each invocation of scala:compile hangs the build for several seconds. After some digging into the plugin code I found out, that it does cold start of the compiler infrastructure each time it is invoked. I managed to rearrange some code to make it possible to share the compiler bridge jar and compiler objects via static fields. This simple change reduces mvn clean install (without tests) execution time by ~50%.

davidB commented 10 months ago

@micossow Thanks for the PR.

I no longer actively maintain the plugin, especially the SBT parts. @slandelle can you look at it when you'll have time?