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%.
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%.