我最近将项目构建从ant切换到了maven和m2e,这工作正常,现在突然每次我保存文件时,建筑工作区占用了大约5到10秒的时间,它过去,当我刚刚保存文件时,我从未注意到eclipse会做任何事情。
我猜测m2e在增量构建期间正在做一些事情,这会减慢事情的速度。我不知道是什么导致了经济放缓。我正在寻找可以试图找出这种放缓原因的事情。
我可以采取哪些选项或步骤来帮助我找出导致此问题的原因。
更新:这是一个多模块项目,包含17个模块16个罐子和一个战争。这是在标准maven层次结构中安排的。
更新:项目清理在非常快的机器上占用大约30到85秒的挂钟时间。 Web项目本身需要大约1秒才能构建,我无法判断问题是在m2e还是在其他地方。
UPDATE:保存.java文件会导致工作区重建,可能会以不可预测的方式重建0到15秒。
更新:我正在使用带有工作区工件分辨率的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)
更新 这原来是日食STS中的弹簧工具越来越慢,摆脱弹簧项目性质修复问题。似乎Spring源团队意识到这些问题正在修复,请参阅下面的答案以获取一些链接。
答案 0 :(得分:7)
经过多次努力之后,事实证明Spring Tool Suite 3.1存在问题,一旦我从项目工作空间中移除弹簧性质,构建时间从30-90秒减少到不到3秒。
我发现.metadata/.plugins/org.eclipse.m2e.logback.configuration/
包含m2e logging logback.1.2.0.20120903-1050.xml
的配置文件,当我更改它以打印出调试信息时
<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。我在这里发布这个信息,以防它可能对其他人有用。