且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用 Maven 和 IntelliJ IDEA 处理大型项目的技巧

更新时间:2021-12-16 01:10:16

按照@CrazyCoder 的建议,我按照官方FAQ 中关于此事的步骤:

As suggested by @CrazyCoder, I followed the steps on the official FAQ regarding this matter:

IntellJ IDEA 性能问题的常见解决方案

具体来说,以下内容似乎产生了明显的影响:

Specifically, the following seemed to have had an appreciable affect:

  1. c:/Users/$user/.IntelliJIdea12 移动到 McAfee 的按访问扫描仪排除的位置,并更新了 $INTELLJ_INSTALL_FOLDER/bin/idea.properties 像这样指向新位置(其中 c:/dev 是 McAfee 排除的文件夹):

  1. Moved the c:/Users/$user/.IntelliJIdea12 to a location excluded by McAfee's on-access-scanner, and updated $INTELLJ_INSTALL_FOLDER/bin/idea.properties to point to the new location like so (where c:/dev is the folder excluded by McAfee):

idea.config.path=c:/dev/.IntelliJIdea12/config
idea.system.path=c:/dev/.IntelliJIdea12/system
idea.plugins.path=c:/dev/.IntelliJIdea12/config/plugins
idea.log.path=c:/dev/.IntelliJIdea12/system/log

idea.config.path=c:/dev/.IntelliJIdea12/config
idea.system.path=c:/dev/.IntelliJIdea12/system
idea.plugins.path=c:/dev/.IntelliJIdea12/config/plugins
idea.log.path=c:/dev/.IntelliJIdea12/system/log

  • $INTELLJ_INSTALL_FOLDER/bin/idea.properties 中设置 idea.jars.nocopy=true,如 这篇博文.

  • In $INTELLJ_INSTALL_FOLDER/bin/idea.properties set idea.jars.nocopy=true as documented in this blog post.

    恢复为库存$INTELLIJ_INSTALL_FOLDER/bin/idea64.exe.vmoptions.剩下的唯一更改是 Too low heap size for a 64-位JVM.这是我目前在该文件中的内容:

    Reverted back to the stock $INTELLIJ_INSTALL_FOLDER/bin/idea64.exe.vmoptions. The only changes that remains are those suggested in Too low heap size for a 64-bit JVM. Here is what I have in the that file currently:

    -Xms1200m
    -Xmx1200m
    -XX:+UseCompressedOops
    -XX:MaxPermSize=350m
    -XX:ReservedCodeCacheSize=96m
    -XX:+UseCodeCacheFlushing
    -ea
    -Dsun.io.useCanonCaches=false
    -Djava.net.preferIPv4Stack=true

    -Xms1200m
    -Xmx1200m
    -XX:+UseCompressedOops
    -XX:MaxPermSize=350m
    -XX:ReservedCodeCacheSize=96m
    -XX:+UseCodeCacheFlushing
    -ea
    -Dsun.io.useCanonCaches=false
    -Djava.net.preferIPv4Stack=true

  • 禁用 Git 集成插件,因为我主要使用命令行 Cygwin-Git.

  • Disabled Git integration plugin since I mostly use command line Cygwin-Git.

    监控 .IntelliJIdea12/idea.log 很有用.例如:我在尝试打开项目中的 zip 文件时发现它经常记录错误后,我禁用了 osmorc(用于 OSGI)插件.示例错误:

    It was useful to monitor .IntelliJIdea12/idea.log. For example : I disabled the osmorc (for OSGI) plugin after seeing that it was frequently logging error while trying to opening zip files in the projects. Sample error :

    警告 - pi.vfs.impl.jar.JarHandlerBase - 打开 zip 文件时出错:C:deva-maven-projectpom.xml java.util.zip.ZipException: 错误打开 zip 文件在 java.util.zip.ZipFile.open(本机方法)
    在 java.util.zip.ZipFile.(ZipFile.java:127)
    在 java.util.zip.ZipFile.(ZipFile.java:143)

    WARN - pi.vfs.impl.jar.JarHandlerBase - error in opening zip file: C:deva-maven-projectpom.xml java.util.zip.ZipException: error in opening zip file at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.(ZipFile.java:127)
    at java.util.zip.ZipFile.(ZipFile.java:143)

  • 禁用所有我不需要的插件.当前禁用的插件列表是:

  • Disabled all the plugins that I do not need. The current list of disabled plugins is :

    禁用插件:ASP (0.1)、Android Designer、Android Support (10.0)、用于 IntelliJ IDE (3.0.9, SVN:1212171008) 的 Atlassian 连接器,基础Cucumber (1.0), BashSupport (1.1beta16), CFML Support (3.53),CheckStyle-IDEA (4.2)、ClearCase 集成 (2.0)、Cloud Foundry集成 (1.0)、CloudBees 集成 (1.0)、指挥官 (1.0.0)、复制为 HTML (0.8.1)、Cucumber for Groovy (1.0)、Cucumber for Java(1.0)、数据库导航器 (3.0.2501)、描述键 (0.3)、Drools支持 (1.0)、Eclipse 集成 (3.0)、Flash/Flex 支持 (1.0)、GWT 支持 (1.0)、Geronimo 集成 (1.0)、Git 集成 (8.1)、GitHub、Google App Engine 集成 (1.1.4)、Grep 控制台 (1.1)、GuiceyIDEA (8.0), HAML, IDEtalk (1.0), IdeaVim (0.28), 标识符荧光笔 (3.62)、IntelliJad Plus (0.5.6)、JBoss 集成 (1.0)、JBoss jBPM (2.0.0), JRebel Plugin (2.0.2), JavaFX (1.0), Key 启动器(1.0.11), Log4JPlugin (1.02), Markdown (0.8.3), Osmorc (1.4.3),Perforce 集成 (2.0)、PluginUpdateNotifier (2.0.3)、RemoteTail(0.3.4)、Resin 集成 (8.1)、Ruby (5.4.0.20130410)、SQL 查询插件 (2.2)、SSH 远程运行 (0.1)、Seam 页面流支持 (1.0)、Seam页面支持 (1.0)、Seam 支持 (1.0)、SmarterEditor (0.8.3)、Struts导航器插件 (1.3.4)、Subversion 集成 (1.1)、TFS集成 (999.999)、Tapestry 支持 (1.0)、TestNG-J (8.0)、UI设计师、UI 设计师(核心)、Vaadin 支持(1.0)、Visual SourceSafe集成 (2.0)、WebLogic 集成 (1.0)、WebSphere 集成(1.0), ZKM-Unscramble (1.0), dmServer 支持 (0.9.5), hg4idea (10.0),soapUI 插件 (3.5)

    Disabled plugins: ASP (0.1), Android Designer, Android Support (10.0), Atlassian Connector for IntelliJ IDE (3.0.9, SVN:1212171008), Base Cucumber (1.0), BashSupport (1.1beta16), CFML Support (3.53), CheckStyle-IDEA (4.2), ClearCase Integration (2.0), Cloud Foundry integration (1.0), CloudBees integration (1.0), Commander (1.0.0), Copy as HTML (0.8.1), Cucumber for Groovy (1.0), Cucumber for Java (1.0), Database Navigator (3.0.2501), Describe Key (0.3), Drools Support (1.0), Eclipse Integration (3.0), Flash/Flex Support (1.0), GWT Support (1.0), Geronimo Integration (1.0), Git Integration (8.1), GitHub, Google App Engine Integration (1.1.4), Grep Console (1.1), GuiceyIDEA (8.0), HAML, IDEtalk (1.0), IdeaVim (0.28), Identifier Highlighter (3.62), IntelliJad Plus (0.5.6), JBoss Integration (1.0), JBoss jBPM (2.0.0), JRebel Plugin (2.0.2), JavaFX (1.0), Key promoter (1.0.11), Log4JPlugin (1.02), Markdown (0.8.3), Osmorc (1.4.3), Perforce Integration (2.0), PluginUpdateNotifier (2.0.3), RemoteTail (0.3.4), Resin Integration (8.1), Ruby (5.4.0.20130410), SQL Query Plugin (2.2), SSH Remote Run (0.1), Seam Pageflow Support (1.0), Seam Pages Support (1.0), Seam Support (1.0), SmarterEditor (0.8.3), Struts Navigator Plugin (1.3.4), Subversion Integration (1.1), TFS Integration (999.999), Tapestry support (1.0), TestNG-J (8.0), UI Designer, UI Designer (Core), Vaadin Support (1.0), Visual SourceSafe Integration (2.0), WebLogic Integration (1.0), WebSphere Integration (1.0), ZKM-Unscramble (1.0), dmServer Support (0.9.5), hg4idea (10.0), soapUI Plugin (3.5)