使用 Maven 和 IntelliJ IDEA 处理大型项目的技巧 [英] Tips for Handling large projects with Maven and IntelliJ IDEA

查看:35
本文介绍了使用 Maven 和 IntelliJ IDEA 处理大型项目的技巧的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读 这篇 博客文章介绍了团队使用 Intellij Idea 进行大型 maven 项目的经验,还查看了 类似 大约 2 年前针对 IDEA v.10.0.2 发布的问题.

I was reading this blog post about the experience of a team using Intellij Idea for large maven projects and have also looked at a similar question posted around 2 years back for IDEA v.10.0.2.

前面提到的一个技巧很有意义:
C:Users$user.IntelliJIdea12 移动到防病毒软件无法访问扫描的文件夹中.

One of the tips mentioned in the former made a whole lot of sense :
Move C:Users$user.IntelliJIdea12 into a folder not access-scanned by the antivirus.

我搜索了以性能为中心的 VM 选项,目前我的 idea64.exe.vmoptions 看起来像这样:

I have searched around for performance centric VM options and currently my idea64.exe.vmoptions looks like this :

-Xms1200m
-Xmx1200m
-XX:MaxPermSize=200m
-ea
-server
-XX:+DoEscapeAnalysis
-XX:+UseCompressedOops
-XX:+UnlockExperimentalVMOptions
-XX:+UseParallelGC
-XX:ReservedCodeCacheSize=64m
-XX:+UseCodeCacheFlushing
-Dsun.io.useCanonCaches=false

问题

  1. 您还有其他类似的技巧来提高大型/大型 maven 项目的 Intellij IDEA(12.1.3、64 位)性能吗?

  1. Do you have any more such tips to improve Intellij IDEA (12.1.3, 64 bit) performance with large/huge maven projects ?

您能否分享您在 idea64.exe.vmoptions 和/或 IDEA 配置中的 idea.properties 中的虚拟机选项的发现.

Could you please share discoveries you have made w.r.t VM options in idea64.exe.vmoptions and/or IDEA configuration in idea.properties.

我曾尝试使用 JDK 7 来启动 IDEA,但这似乎并没有以一种或另一种方式严重影响它的性能.如果您尝试过这样做,您是否也有同样的经历?

I have tried using JDK 7 to startup IDEA but this does not seem to terribly affect it's performance one way or the other. If you have tried doing so, did you experience the same ?

推荐答案

按照@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)

  • 这篇关于使用 Maven 和 IntelliJ IDEA 处理大型项目的技巧的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆