gpt4 book ai didi

eclipse - 如何确定 m2e 减慢 eclipse 构建速度的原因?

转载 作者:行者123 更新时间:2023-12-02 10:33:42 25 4
gpt4 key购买 nike

我最近将项目构建从 ant 切换到 maven 和 m2e,这工作正常,现在每次我保存文件时,构建工作区都会占用大量时间,大约 5 到 10 秒,它过去,当我刚刚保存文件时,我什至没有注意到 Eclipse 做了任何事情,这不需要时间。

我猜测 m2e 在增量构建期间正在做一些事情,这会减慢速度。我不知道是什么导致了速度放缓。我正在寻找可以尝试找出速度放缓的原因的东西。

我可以采取哪些选项或步骤来帮助我找出此问题的原因。

更新:这是一个多模块项目,包含 17 个模块、16 个 jar 和一场 war 。这是按照标准 Maven 层次结构排列的。

更新:在非常快的机器上,项目清理全部需要大约 30 到 85 秒的挂钟时间。 Web 项目本身需要大约 1 秒来构建,我无法判断问题是出在 m2e 还是其他地方。

更新:保存 .java 文件会导致工作区重建,该重建可能会以一种不可预测的方式持续 0 到 15 秒。

更新:我正在使用带有工作区 Artifact 解析的 m2e-wtp 扩展。

更新:m2e 日志文件的一些输出

2012-12-28 17:10:43,907 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Mojo execution key: org.apache.maven.plugins:maven-enforcer-plugin:1.2:enforce (execution: enforce-rules, phase: validate)
2012-12-28 17:10:43,907 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Action: ignore
2012-12-28 17:10:43,907 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Mojo execution key: pl.project13.maven:git-commit-id-plugin:2.1.2:revision (execution: default, phase: initialize)
2012-12-28 17:10:43,907 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Action: ignore
2012-12-28 17:10:43,907 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Mojo execution key: org.apache.maven.plugins:maven-resources-plugin:2.6:resources (execution: default-resources, phase: process-resources)
2012-12-28 17:10:43,908 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Action: execute
2012-12-28 17:10:43,908 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Mojo execution key: org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (execution: default-compile, phase: compile)
2012-12-28 17:10:43,908 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Action: configurator
2012-12-28 17:10:43,908 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Project configurator id: org.eclipse.m2e.jdt.javaConfigurator
2012-12-28 17:10:43,908 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Project configurator: org.eclipse.m2e.jdt.internal.JavaProjectConfigurator
2012-12-28 17:10:43,908 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Action: configurator
2012-12-28 17:10:43,908 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Project configurator id: org.maven.ide.eclipse.configuration.wtp.webfragment.configurator
2012-12-28 17:10:43,908 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Project configurator: org.eclipse.m2e.wtp.WebFragmentProjectConfigurator
2012-12-28 17:10:43,908 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Action: configurator
2012-12-28 17:10:43,908 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Project configurator id: org.maven.ide.eclipse.configuration.wtp.utility.configurator
2012-12-28 17:10:43,908 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Project configurator: org.eclipse.m2e.wtp.UtilityProjectConfigurator
2012-12-28 17:10:43,908 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Action: configurator
2012-12-28 17:10:43,908 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Project configurator id: org.maven.ide.eclipse.configuration.wtp.java.unsupportedDependencyTypeConfigurator
2012-12-28 17:10:43,908 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Project configurator: org.eclipse.m2e.wtp.UnsupportedDependencyTypeProjectConfigurator
2012-12-28 17:10:43,908 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Action: configurator
2012-12-28 17:10:43,908 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Project configurator id: com.springsource.sts.ide.maven.core.springProjectConfigurator
2012-12-28 17:10:43,908 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Project configurator: org.springframework.ide.eclipse.maven.internal.core.SpringProjectConfigurator
2012-12-28 17:10:43,908 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Mojo execution key: org.apache.maven.plugins:maven-resources-plugin:2.6:testResources (execution: default-testResources, phase: process-test-resources)
2012-12-28 17:10:43,908 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Action: execute
2012-12-28 17:10:43,909 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Mojo execution key: org.apache.maven.plugins:maven-compiler-plugin:2.5.1:testCompile (execution: default-testCompile, phase: test-compile)
2012-12-28 17:10:43,909 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Action: configurator
2012-12-28 17:10:43,909 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Project configurator id: org.eclipse.m2e.jdt.javaConfigurator
2012-12-28 17:10:43,909 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Project configurator: org.eclipse.m2e.jdt.internal.JavaProjectConfigurator
2012-12-28 17:10:43,909 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Action: configurator
2012-12-28 17:10:43,909 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Project configurator id: org.maven.ide.eclipse.configuration.wtp.webfragment.configurator
2012-12-28 17:10:43,909 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Project configurator: org.eclipse.m2e.wtp.WebFragmentProjectConfigurator
2012-12-28 17:10:43,909 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Action: configurator
2012-12-28 17:10:43,909 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Project configurator id: org.maven.ide.eclipse.configuration.wtp.utility.configurator
2012-12-28 17:10:43,909 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Project configurator: org.eclipse.m2e.wtp.UtilityProjectConfigurator
2012-12-28 17:10:43,909 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Action: configurator
2012-12-28 17:10:43,909 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Project configurator id: org.maven.ide.eclipse.configuration.wtp.java.unsupportedDependencyTypeConfigurator
2012-12-28 17:10:43,909 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Project configurator: org.eclipse.m2e.wtp.UnsupportedDependencyTypeProjectConfigurator
2012-12-28 17:10:43,909 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Action: configurator
2012-12-28 17:10:43,909 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Project configurator id: com.springsource.sts.ide.maven.core.springProjectConfigurator
2012-12-28 17:10:43,909 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Project configurator: org.springframework.ide.eclipse.maven.internal.core.SpringProjectConfigurator
2012-12-28 17:10:43,909 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Mojo execution key: org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (execution: default-test, phase: test)
2012-12-28 17:10:43,909 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Mojo execution key: org.apache.maven.plugins:maven-war-plugin:2.3:war (execution: default-war, phase: package)
2012-12-28 17:10:43,909 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Action: configurator
2012-12-28 17:10:43,909 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Project configurator id: org.maven.ide.eclipse.configuration.wtp.configurator
2012-12-28 17:10:43,909 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Project configurator: org.eclipse.m2e.wtp.WTPProjectConfigurator
2012-12-28 17:10:43,909 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Build participant: org.eclipse.m2e.wtp.internal.filtering.ResourceFilteringBuildParticipant
2012-12-28 17:10:43,910 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Action: configurator
2012-12-28 17:10:43,910 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Project configurator id: org.maven.ide.eclipse.configuration.wtp.warmanifest.configurator
2012-12-28 17:10:43,910 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Project configurator: org.eclipse.m2e.wtp.internal.mavenarchiver.WarMavenArchiverConfigurator
2012-12-28 17:10:43,910 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Build participant: org.sonatype.m2e.mavenarchiver.internal.AbstractMavenArchiverConfigurator$1
2012-12-28 17:10:43,910 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Action: configurator
2012-12-28 17:10:43,910 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Project configurator id: org.maven.ide.eclipse.configuration.wtp.overlay.configurator
2012-12-28 17:10:43,910 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Project configurator: org.eclipse.m2e.wtp.OverlayConfigurator
2012-12-28 17:10:43,910 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Mojo execution key: org.apache.maven.plugins:maven-install-plugin:2.4:install (execution: default-install, phase: install)
2012-12-28 17:10:43,910 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Mojo execution key: org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (execution: default-deploy, phase: deploy)

更新:事实证明,这是 eclipse STS 中的 spring 工具有缺陷且缓慢,摆脱 spring 项目性质解决了该问题。似乎 Spring 源团队已经意识到这些问题正在修复,请参阅下面我的回答以获取一些链接。

最佳答案

经过一番绞尽脑汁,结果发现 Spring Tool Suite 3.1 是问题所在,一旦我从项目工作区中删除了 spring 特性,构建时间就从 30 - 90 秒减少到不到 3 秒。

我发现.metadata/.plugins/org.eclipse.m2e.logback.configuration/包含m2e日志记录的配置文件logback.1.2.0.20120903-1050.xml code>当我更改它以打印出调试信息时

  <root level="DEBUG">
<appender-ref ref="FILE" />
<appender-ref ref="STDOUT" />
<appender-ref ref="EclipseLog" />
<appender-ref ref="MavenConsoleLog" />
</root>

<logger name="com.ning.http.client" level="DEBUG" />

我可以在 .metadata/.plugins/org.eclipse.m2e.logback.configuration/0.log 中获得输出,该输出具有时间戳,并且 m2e 似乎运行了多次当 .java 文件获取时。

我一直无法弄清楚如何使用日志文件中的信息来解决我的问题,我几乎要放弃 m2e 了。我在这里发布此信息,以防对其他人有用。

关于eclipse - 如何确定 m2e 减慢 eclipse 构建速度的原因?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14025812/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com