javamavenintellij-ideajrebel

My Intellij-IDEA build my project too slow for Jrebel


Last month, I was using IntelliJ IDEA Community which equipped with Jrebel.If I update one line of the html or Java file, and immediately press ctrl+F9, It will only take 2~3 sec.

Recently, I choose to use IntelliJ IDEA Ultimate instead, which also equipped with Jrebel.After same actions, It will take 8~11 sec. I believe it is too slow.

I have seen details of my IntelliJ's building. I believe it execute so many unnecessary steps,such as installing. All the information is as below:

[INFO] Scanning for projects...
[INFO] 
[INFO] -------------------------< com.*:centre >--------------------------
[INFO] Building centre 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ centre ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO] Copying 30 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ centre ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ centre ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory F:\my\centre\src\test\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ centre ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) @ centre ---
[INFO] Tests are skipped.
[INFO] 
[INFO] --- maven-jar-plugin:3.1.2:jar (default-jar) @ centre ---
[INFO] Building jar: F:\my\centre\target\centre-0.0.1-SNAPSHOT.jar
[INFO] 
[INFO] --- spring-boot-maven-plugin:2.2.2.RELEASE:repackage (repackage) @ centre ---
[INFO] Replacing main artifact with repackaged archive
[INFO] 
[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ centre ---
[INFO] Installing F:\my\centre\target\centre-0.0.1-SNAPSHOT.jar to H:\localRepository\com\*\centre\0.0.1-SNAPSHOT\centre-0.0.1-SNAPSHOT.jar
[INFO] Installing F:\my\centre\pom.xml to H:\localRepository\com\*\centre\0.0.1-SNAPSHOT\centre-0.0.1-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  7.280 s
[INFO] Finished at: 2021-02-16T11:59:46+08:00
[INFO] ------------------------------------------------------------------------

Process finished with exit code 0


Solution

  • IntelliJ recently introduced a feature to delegate build and run actions to the build tool which seems to be happening in your case. The feature is useful for overly complicated project setups that generate and process classes/resources using various plugins. In such cases IntelliJ's own build wouldn't know of these plugins and may not produce correct output. The downside is that a full maven build takes more time and unlike NetBeans, IntelliJ currently doesn't allow specifying goals (e.g. package) to run during a build and will run a full mvn install. Instead of invoking Build you may manually run a maven goal if building via maven is needed but want more control.

    Standard projects like yours can disable the feature via File | Settings | Build, Execution, Deployment | Build Tools | Maven | Runner | Delegate IDE build/run actions to Maven