Eclipse 无休止地循环:调用“Maven Project Builder”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8116283/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 20:41:24  来源:igfitidea点击:

Eclipse loops endlessly: Invoking 'Maven Project Builder'

eclipsemavenm2eclipse

提问by Justin

Ugh! My Eclipse is stuck in an endless loop:

啊! 我的 Eclipse 陷入无限循环:

  • No operations to display at this time
  • Refreshing Workspace Building
  • Workspace. Invoking 'Maven Project Builder' on /MobileWebApp
  • 暂无操作显示
  • 令人耳目一新的工作空间建筑
  • 工作区。在 /MobileWebApp 上调用“Maven Project Builder”

The building workspace never gets past 58%.

建筑工作空间永远不会超过 58%。

Details:

细节:

Google's GWT provides a sample app MobileWebApp. They suggest adding it to Eclipsevia File > Import > Checkout Maven projects from SCM.

Google 的 GWT 提供了一个示例应用程序 MobileWebApp。他们建议通过 File > Import > Checkout Maven projects from SCM将它添加到 Eclipse

I followed the instructions in this blogfor adding the plugins for m2e, subclipse, and the m2e-subclipse connector.

我按照此博客中的说明添加了 m2e、subclipse 和 m2e-subclipse 连接器的插件。

After installing the plugins, I imported the sample project via File > Import > Checkout Maven projects from SCM and this URL.

安装插件后,我通过 File > Import > Checkout Maven projects from SCM 和这个 URL导入了示例项目。

The import seemed to complete ok and Eclipse doesn't display any markers. But now I have this endless refreshing and building and have no clue what is causing it or how to fix it.

导入似乎完成了,Eclipse 没有显示任何标记。但是现在我有这种无尽的刷新和构建,并且不知道是什么导致它或如何修复它。

Versions:

版本:

  • Eclipse Indigo 3.7
  • m2e 1.0.100
  • m2e connector for build-helper-maven-plugin 0.14
  • Maven SCM handler for Subclipse 0.13
  • Subclipse 1.6.18
  • Subclipse Client Adapter 1.6.12
  • 日食靛蓝 3.7
  • m2e 1.0.100
  • 用于 build-helper-maven-plugin 0.14 的 m2e 连接器
  • Subclipse 0.13 的 Maven SCM 处理程序
  • 子剪辑 1.6.18
  • Subclipse 客户端适配器 1.6.12

Any advice is greatly appreciated.

任何意见是极大的赞赏。

采纳答案by Justin

I was able to resolve this by right clicking on the project and selecting Run As > Maven Clean

我可以通过右键单击项目并选择 Run As > Maven Clean 来解决这个问题

回答by Fred Campos

I opened my module's .project file. There were two entries:

我打开了模块的 .project 文件。有两个条目:

<buildCommand>
  <name>org.maven.ide.eclipse.maven2Builder</name>
</buildCommand>
<buildCommand>
  <name>org.eclipse.m2e.core.maven2Builder</name>
</buildCommand>

I removed org.eclipse.m2e.core.maven2Builder entry and it magically fixed the problem.

我删除了 org.eclipse.m2e.core.maven2Builder 条目,它神奇地解决了这个问题。

回答by Amos M. Carpenter

I was getting the same issue in an eclipse (Juno) Maven project that had nothing to do with GWT - it just kept refreshing and "Invoking Maven Project Builder". Going to the Progress view and requesting a cancellation of either progress entry (by clicking that red stop button on the right) didn't help.

我在与 GWT 无关的 Eclipse (Juno) Maven 项目中遇到了同样的问题——它只是不断刷新和“调用 Maven 项目生成器”。转到“进度”视图并请求取消任一进度条目(通过单击右侧的红色停止按钮)没有帮助。

The project the builder kept getting stuck on was always the same, and a couple of levels deep in a set of multi-pom maven projects in eclipse.

构建器一直坚持的项目总是相同的,并且在 eclipse 中的一组多 pom maven 项目中深入了几个级别。

What eventually solved it for me was just going into that particular project's Properties> Buildersand unchecking Maven Project Builder(but keeping the Java Builderchecked so that it would still auto-build when code changed). I just ignored the warning about this being an "advanced operation" and possibly having "many side-effects" - I figured it couldn't be any more annoying than that constant build-refresh cycle. I'm still not sure what the cause of this loop was, but that stopped it for me. And I haven't had any problems since.

最终为我解决的只是进入该特定项目的Properties>Builders并取消选中Maven Project Builder(但保持Java Builder选中状态,以便在代码更改时它仍会自动构建)。我只是忽略了关于这是一个“高级操作”并且可能有“许多副作用”的警告——我认为它不会比持续的构建-刷新周期更烦人了。我仍然不确定这个循环的原因是什么,但这对我来说停止了。从那以后我没有遇到任何问题。

回答by Chris Hinshaw

I actually solved the problem that was caused by the jaxb plugin. If the forceRegenerate is set to true you will get the build loop in eclipse (Kepler in my case).

我实际上解决了由 jaxb 插件引起的问题。如果 forceRegenerate 设置为 true,您将在 eclipse 中获得构建循环(在我的情况下为 Kepler)。

Verify that you have forceRegenerate set to false in your maven-jaxb-plugin.

验证您在 maven-jaxb-plugin 中是否将 forceRegenerate 设置为 false。

<configuration>                                  
    <forceRegenerate>false</forceRegenerate>
</configuration>

回答by 99Sono

M2e, even in eclipse mars, seems to like infinite building.

M2e,即使在日食火星,似乎也喜欢无限的建筑。

In my case, no such thing as repeated build commands, as listed bellow. The only thing that seems to work when the project tree is gigantic is:

就我而言,没有重复构建命令之类的东西,如下所列。当项目树巨大时,唯一似乎有效的是:

  1. open eclipse
  2. Disable build automatically as soon as you open eclipse
  3. refresh the workspace and trigger manual a Crtl+Bor a build all.
  4. Once eclipse is satisfied that it build the full project tree ... better have four core machine or you're gonna be waiting a while, you can finely put the build automatically option active. Eclipse seems not to go in a building spree after that. It will still go for a while scanning some folders, but activating the build automatically - once you've built it all before - is much faster than a new build all, and finally, eclipse becomes stable stops building infinitely.
  1. 开放日食
  2. 打开 eclipse 后立即禁用自动构建
  3. 刷新工作区并触发手动Crtl+B或全部构建。
  4. 一旦 Eclipse 对它构建完整的项目树感到满意......最好有四核机器,否则你会等待一段时间,你可以很好地激活自动构建选项。之后 Eclipse 似乎并没有大肆建设。它仍然会扫描一些文件夹一段时间,但是自动激活构建 - 一旦你之前构建了它 - 比新构建快得多,最后,eclipse变得稳定无限地停止构建。

Otherwise, you're stuck with the deprecated mvn eclipse:eclipse ...and have to abandon the use of maven commands from within eclipse echosystem. M2e seems to have a really gigantic hard time cooperating with the beast.

否则,您将被弃用 mvn eclipse:eclipse ...,不得不放弃使用 eclipse echosystem 中的 maven 命令。M2e似乎很难与野兽合作。

I still use m2e, but must say it is 100 times more difficult to swallow m2e than maven integration in netbeans. On the otherhand, eclipse is much faster for very large code base. Pick your poison, you'll always get bitten.

我仍然使用 m2e,但必须说吞下 m2e 比 netbeans 中的 maven 集成难 100 倍。另一方面,eclipse 对于非常大的代码库要快得多。选择你的毒药,你总是会被咬伤。

 <?xml version="1.0" encoding="UTF-8"?>
    <projectDescription>
        <name>rootPom</name>
        <comment></comment>
        <projects>
        </projects>
        <buildSpec>
            <buildCommand>
                <name>org.eclipse.m2e.core.maven2Builder</name>
                <arguments>
                </arguments>
            </buildCommand>
        </buildSpec>
        <natures>
            <nature>org.eclipse.m2e.core.maven2Nature</nature>
        </natures>
    </projectDescription>

回答by Parthi

  1. I have configured the java environment variable properly (i.e., JAVA_HOME).
  2. Also added the jdk path to the environment variable path, in my case path is C:\Program Files\Java\jdk1.8.0_101\bin.
  3. Also I added path to JDK home in "Installed JREs" preference in Eclipse.
  1. 我已经正确配置了 java 环境变量(即JAVA_HOME)。
  2. 还将 jdk 路径添加到环境变量中path,在我的情况下路径是C:\Program Files\Java\jdk1.8.0_101\bin.
  3. 我还在 Eclipse 的“已安装 JRE”首选项中添加了 JDK 主目录的路径。

Not sure which one of this resolved the issue, I don't see auto build happening now.

不确定其中哪一个解决了问题,我现在没有看到自动构建发生。

After this, I created a new maven project. Which was set to use the 1.7 by default, this project too resulted in endless loop. But 1.7 is not configured in eclipse. Updating the project properties to use the java version available in my eclipse has resolved the issue.

在此之后,我创建了一个新的 maven 项目。默认情况下设置为使用 1.7,这个项目也导致了无限循环。但是1.7没有在eclipse中配置。更新项目属性以使用我的 eclipse 中可用的 java 版本已经解决了这个问题。

回答by hitesh karel

This issue generally also comes when maven unable to delete some file may that is having too long name. So you can manually go to your target folder and clean it and restart eclipse.

当 maven 无法删除某些名称过长的文件时,通常也会出现此问题。因此,您可以手动转到目标文件夹并清理它并重新启动 eclipse。

回答by Francisco M

I did something similar to Amos M. Carpenter response (https://stackoverflow.com/a/28713259/4470352)

我做了一些类似于 Amos M. Carpenter 的回应(https://stackoverflow.com/a/28713259/4470352

But also I created a new custom builder with the following configuration:

但我也使用以下配置创建了一个新的自定义构建器:

  1. Choose configuration type -> Program
  2. Location (text box) <= D:\apache-maven-3.3.9\bin\mvn.cmd (my custom maven)
  3. Working Directory (text box) <= ${workspace_loc:/project}
  4. Arguments (text area)
    • <= clean compile test-DproxySet=true -DproxyHost=a.proxy.host -DproxyPort=8080
  1. 选择配置类型 -> 程序
  2. 位置(文本框)<= D:\apache-maven-3.3.9\bin\mvn.cmd(我的自定义 maven)
  3. 工作目录(文本框)<= ${workspace_loc:/project}
  4. 参数(文本区域)
    • <= 干净编译测试-DproxySet=true -DproxyHost=a.proxy.host -DproxyPort=8080

This compiles me the project with no progress bar, but i can see the progress in text console.

这为我编译了没有进度条的项目,但我可以在文本控制台中看到进度。

The problem in my case is that every time I compile that project, I download a WSDL and I need to provide proxy configuration. When maven project builder plug-in tries to compile my project, fails and starts again in a loop.

我的问题是每次编译该项目时,我都会下载一个 WSDL,并且需要提供代理配置。当 maven 项目构建器插件尝试编译我的项目时,失败并在循环中再次启动。

I have tried to setup it into settings.xml maven configuration file, but doesn't work for me, and providing proxy configuration in command line works.

我试图将它设置到 settings.xml maven 配置文件中,但对我不起作用,并且在命令行中提供代理配置有效。

So creating that custom builder does the job and is a new approach.

因此,创建该自定义构建器可以完成这项工作,并且是一种新方法。

I hope it to helps you.

我希望它能帮助你。

回答by user10116596

Eclipse on my workstation hangs every time I try to update maven project. The issue is not resolved even after trying a lot of resolutions/workarounds suggested by community. The only thing that works for me is to run mvn clean and install commands from command prompt. I end the task in task manager, run mvn commands and then re-launch eclipse. Running clean build after re-launching eclipse works fine.

每次尝试更新 maven 项目时,我工作站上的 Eclipse 都会挂起。即使在尝试了社区建议的许多解决方案/解决方法后,问题仍未解决。唯一对我有用的是从命令提示符运行 mvn clean 并安装命令。我在任务管理器中结束任务,运行 mvn 命令,然后重新启动 eclipse。重新启动 eclipse 后运行 clean build 工作正常。

回答by Matthias

I linked some files in eclipse but the source file was missing (deleted in the meantime). This caused eclipse to restart the build. Deleting the broken link solved the problem.

我在 Eclipse 中链接了一些文件,但源文件丢失(同时删除)。这导致 eclipse 重新启动构建。删除断开的链接解决了问题。