我的 Intellij-IDEA 构建我的项目对于 Jrebel 来说太慢了

My Intellij-IDEA build my project too slow for Jrebel

上个月,我在使用配备Jrebel.If的IntelliJ IDEA社区,我更新了html或Java文件的一行,然后立即按ctrl+F9,它会只需2~3秒

最近,我选择使用 IntelliJ IDEA Ultimate,它也配备了 Jrebel.After 相同的操作,需要 8~11 秒。我认为它太慢了。

我已经看到了我的 IntelliJ 建筑的细节。我相信它执行了很多不必要的步骤,比如安装。所有信息如下:

[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[=10=].0.1-SNAPSHOT\centre-0.0.1-SNAPSHOT.jar
[INFO] Installing F:\my\centre\pom.xml to H:\localRepository\com\*\centre[=10=].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

IntelliJ 最近引入了一项将构建和 运行 操作委托给构建工具的功能,这似乎发生在您的案例中。该功能对于使用各种插件生成和处理 classes/resources 的过于复杂的项目设置很有用。在这种情况下,IntelliJ 自己的构建不会知道这些插件,并且可能不会产生正确的输出。缺点是完整的 Maven 构建需要更多时间,并且与 NetBeans 不同,IntelliJ 目前不允许在构建期间将目标(例如 package)指定为 运行,并且将 运行 完整 mvn install。如果需要通过 Maven 构建但想要更多控制,您可以手动 运行 Maven 目标而不是调用构建。

像您这样的标准项目可以通过 File | Settings | Build, Execution, Deployment | Build Tools | Maven | Runner | Delegate IDE build/run actions to Maven

禁用该功能