Eclipse 无限循环:调用“Maven Project Builder”;

发布于 2024-12-15 17:50:15 字数 1059 浏览 5 评论 0原文

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

  • 此时没有可显示的操作
  • 正在刷新工作区正在构建
  • 工作区。在 /MobileWebApp 上调用“Maven Project Builder”

构建工作区永远不会超过 58%。

详细信息:

Google 的 GWT 提供了一个示例应用程序 MobileWebApp。他们建议通过 File > 将其添加到 Eclipse ;导入>从 SCM 签出 Maven 项目。

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

安装插件后,我通过 File > 导入示例项目导入>从 SCM 和此网址签出 Maven 项目。

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

版本:

  • Eclipse Indigo 3.7
  • m2e 1.0.100
  • 用于 build-helper-maven-plugin 的 m2e 连接器 0.14
  • 用于 Subclipse 的 Maven SCM 处理程序 0.13
  • Subclipse 1.6.18
  • Subclipse 客户端适配器 1.6.12

非常感谢任何建议。

Ugh! My Eclipse is stuck in an endless loop:

  • No operations to display at this time
  • Refreshing Workspace Building
  • Workspace. Invoking 'Maven Project Builder' on /MobileWebApp

The building workspace never gets past 58%.

Details:

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

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

After installing the plugins, I imported the sample project via File > Import > Checkout Maven projects from SCM and this 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.

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

Any advice is greatly appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(20

玩物 2024-12-22 17:50:16

我可以通过右键单击该项目并选择“运行方式”来解决此问题Maven 清洁

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

ゞ记忆︶ㄣ 2024-12-22 17:50:16

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

构建者一直陷入困境的项目总是相同的,并且在 Eclipse 中的一组多 pom Maven 项目中深入了几个级别。

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

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.

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.

What eventually solved it for me was just going into that particular project's Properties > Builders and unchecking Maven Project Builder (but keeping the Java Builder checked 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.

埖埖迣鎅 2024-12-22 17:50:16

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

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

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

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).

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

<configuration>                                  
    <forceRegenerate>false</forceRegenerate>
</configuration>
尹雨沫 2024-12-22 17:50:16

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

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

  1. 打开 Eclipse 打开
  2. Eclipse 后立即禁用自动构建
  3. 刷新工作区并触发手动 Crtl+B或全部构建。
  4. 一旦 eclipse 满意它构建了完整的项目树...最好有四核机器,否则你会等待一段时间,你可以很好地将自动构建选项置于活动状态。此后 Eclipse 似乎并没有再掀起建设热潮。它仍然会扫描一些文件夹一段时间,但是自动激活构建 - 一旦你之前构建了所有内容 - 比新的所有构建要快得多,最后, Eclipse 变得稳定,停止无限构建。

否则,您将陷入已弃用的 mvn eclipse:eclipse ...
并且必须放弃在 eclipse echosystem 中使用 Maven 命令。 M2e 似乎很难与这头野兽合作。

我仍然使用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>

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

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+B or 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.

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.

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.

 <?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>
她如夕阳 2024-12-22 17:50:16

问题可能是代码生成插件,例如 openapi-generator-maven-plugin 或 protoc-jar-maven-plugin。此类插件正在生成重新触发 Eclipse 编译的代码。防止此行为的解决方案可能是禁用 Eclipse“Maven Project Builder”的插件。这可以通过向 pom.xml 添加一个条目来完成,如下所述: https://www.eclipse.org/m2e/documentation/m2e-execution-not-covered.html

<pluginManagement>
    <plugins>
        <plugin>
            <groupId>org.eclipse.m2e</groupId>
            <artifactId>lifecycle-mapping</artifactId>
            <version>1.0.0</version>
            <configuration>
                <lifecycleMappingMetadata>
                    <pluginExecutions>
                        <!-- Add plugin execution configuration here -->
                    </pluginExecutions>
                </lifecycleMappingMetadata>
            </configuration>
        </plugin>
    </plugins>
</pluginManagement>

此类插件配置可能类似于以下示例:

<pluginExecution>
  <pluginExecutionFilter>
    <groupId>org.openapitools</groupId>
    <artifactId>openapi-generator-maven-plugin</artifactId>
    <versionRange>[0.0,)</versionRange>
    <goals>
      <goal>generate</goal>
    </goals>
  </pluginExecutionFilter>
  <action>
    <ignore />
  </action>
</pluginExecution>

或者,此类设置可以全局完成Eclipse 工作区:窗口 > 首选项 > Maven > > 生命周期映射
有关此主题的更多信息可以在此处阅读: https://www.benchresources.net/eclipse-maven-plugin-execution-not-covered-by-lifecycle-configuration/

The problem can be a code generating plugin like the openapi-generator-maven-plugin or the protoc-jar-maven-plugin. Such plugins are generating code that retriggers the eclipse compilation. A solution to prevent this behavior could be to disable the plugin for the Eclipse "Maven Project Builder". This can be done by adding an entry to the pom.xml like described here: https://www.eclipse.org/m2e/documentation/m2e-execution-not-covered.html

<pluginManagement>
    <plugins>
        <plugin>
            <groupId>org.eclipse.m2e</groupId>
            <artifactId>lifecycle-mapping</artifactId>
            <version>1.0.0</version>
            <configuration>
                <lifecycleMappingMetadata>
                    <pluginExecutions>
                        <!-- Add plugin execution configuration here -->
                    </pluginExecutions>
                </lifecycleMappingMetadata>
            </configuration>
        </plugin>
    </plugins>
</pluginManagement>

Such Plugin configuration could look like similar to the following example:

<pluginExecution>
  <pluginExecutionFilter>
    <groupId>org.openapitools</groupId>
    <artifactId>openapi-generator-maven-plugin</artifactId>
    <versionRange>[0.0,)</versionRange>
    <goals>
      <goal>generate</goal>
    </goals>
  </pluginExecutionFilter>
  <action>
    <ignore />
  </action>
</pluginExecution>

Alternatively such settings could be done globally for a eclipse workspace: Window > Preferences > Maven > Lifecycle Mappings.
More about this topic can be read here: https://www.benchresources.net/eclipse-maven-plugin-execution-not-covered-by-lifecycle-configuration/

随心而道 2024-12-22 17:50:16

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

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.

电影里的梦 2024-12-22 17:50:16

当我将 JAVA_HOME 更改为新位置时,有时它对我有用

it some times worked for me when i change my JAVA_HOME to a new location

下雨或天晴 2024-12-22 17:50:16

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

但是我还创建了一个具有以下配置的新自定义构建器:

  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

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

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

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

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

我希望它能帮助你。

I did something similar to Amos M. Carpenter response (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

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.

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.

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

I hope it to helps you.

偏闹i 2024-12-22 17:50:16
  1. 我已经正确配置了java环境变量(即JAVA_HOME)。
  2. 还将jdk路径添加到环境变量path中,在我的例子中路径是C:\Program Files\Java\jdk1.8.0_101\bin
  3. 我还在 Eclipse 的“Installed JREs”首选项中添加了 JDK home 的路径。

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

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

  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.

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.

白鸥掠海 2024-12-22 17:50:16

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

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.

┾廆蒐ゝ 2024-12-22 17:50:16

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

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.

暮倦 2024-12-22 17:50:16

从 eclipse 中删除项目(而不是从磁盘中)。
并导入为“常规>现有项目到工作区”

Delete project from eclipse(not from disk).
And import as "General>Existing Projects into Workspace"

爱的十字路口 2024-12-22 17:50:16

当我从 GitHub 克隆的一个项目将其结构更改为多模块 Maven 项目后,这种情况就发生在我身上。由于一些特定于 Eclipse 的文件位于 .gitignore 中,因此即使在我从 Eclipse 中删除旧项目并使用子模块将其重新导入为新项目后,执行 git pull 仍会保留原始文件。这显然造成了一些混乱,导致了这个问题。

删除项目目录并重新克隆项目解决了该问题。

This was happening to me after a project I cloned from GitHub changed its structure to multi-module Maven project. Since some eclipse-specific files were in .gitignore, doing git pull kept the originals even after I removed the old project from Eclipse and re-imported it as new with submodules. This apparently caused some chaos leading to the issue.

Nuking the project directory and re-cloning the project resolved the issue.

狠疯拽 2024-12-22 17:50:16

日食->首选项-> Maven->装置
删除额外的安装并使用 EMBEDDED 对我有帮助。

触发因素是,我想要一个单独的 Maven 设置
SLF4J:类路径包含多个 SLF4J 绑定。

Eclipse -> Preferences -> Maven -> Installations
Remove additional installation and using EMBEDDED helped me.

The trigger was, that I wanted to have a separated maven setup for
SLF4J: Class path contains multiple SLF4J bindings.

北城挽邺 2024-12-22 17:50:16

就我而言,我正在使用 React 来使用前端插件运行节点。如果节点正在运行,那么它会卡在调用“Maven Project Builder”上。我关闭了节点并尽快完成了调用。在 Eclipse 中运行的节点实例正在产生问题。我使用的是 Windows,因此进入任务管理器我关闭了节点实例,如图所示,它工作正常。您可以检查 eclipse 下是否有任何实例导致问题。 输入图片此处描述

In my case, I was working with react so running node using frontend plugin. If node is running then it stucks on Invoking 'Maven Project Builder'. I closed node and invoking was completed asap. Node instance running in eclipse was creating issue. I am using windows so going into task manager I closed node instances like shown in image and it works fine. You can check if there is any instance under eclipse which is causing issue. enter image description here

空心↖ 2024-12-22 17:50:16

如果上述解决方案均不起作用,

请取消选中:

项目->自动构建

If none of the above solutions work

uncheck:

Project -> Build Automatically

救赎№ 2024-12-22 17:50:16

我在 Eclipse 中打开进度窗口,看到 Maven Project Builder 的进度。在某个时刻,它会创建另一个 Maven 项目生成器。第二个 Maven 项目生成器被阻塞等待。我单击红色 X 删除第二个。第一个完成,循环不再继续。

I open the progress window in Eclipse and see the Maven Project Builder progressing. At some point, it creates another Maven Project Builder. This second Maven Project Builder is blocked waiting. I click on the red X to delete this second one. The first one finishes and the loop does not continue.

好倦 2024-12-22 17:50:16

我也有同样的问题。事实证明,我正在使用管道 (|) 运算符运行 Eclipse,并行运行另一个进程。另一个进程正在干扰我的 Eclipse 线程。一旦我关闭其他进程,Eclipse 就可以正常工作。

I had the same problem. It turns out that I was running Eclipse with the pipe (|) operator, running another process in parallel. The other process was jamming my Eclipse thread. Once I shut down the other process, Eclipse worked fine.

绅士风度i 2024-12-22 17:50:16

除了已接受的答案之外,还有两个类似的案例:
在模块的 .project 文件中,可能有两个冗余条目,删除一个会有所帮助。

<projectDescription>
...
 <buildSpec>
   <buildCommand>
    <name>org.eclipse.m2e.core.maven2Builder</name>
    <arguments>
    </arguments>
   </buildCommand>
   <buildCommand>
    <name>org.eclipse.m2e.core.maven2Builder</name>
    <arguments>
    </arguments>
   </buildCommand>

第二个是两种不同的 Maven 性质:

<projectDescription>
...
 <buildSpec>
   <natures>
     <nature>org.eclipse.m2e.core.maven2Nature</nature>
     <nature>org.maven.ide.eclipse.maven2Nature.</nature>
   </natures>

删除 org.maven.ide.eclipse.maven2Nature 在这种情况下会有所帮助。

In addition to the accepted answer there are two similar cases:
In the module's .project file there could be two redundant entries and deleting one helped.

<projectDescription>
...
 <buildSpec>
   <buildCommand>
    <name>org.eclipse.m2e.core.maven2Builder</name>
    <arguments>
    </arguments>
   </buildCommand>
   <buildCommand>
    <name>org.eclipse.m2e.core.maven2Builder</name>
    <arguments>
    </arguments>
   </buildCommand>

And the 2nd one is two different maven natures:

<projectDescription>
...
 <buildSpec>
   <natures>
     <nature>org.eclipse.m2e.core.maven2Nature</nature>
     <nature>org.maven.ide.eclipse.maven2Nature.</nature>
   </natures>

Removing org.maven.ide.eclipse.maven2Nature helps in that case.

深海夜未眠 2024-12-22 17:50:15

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

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

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

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

<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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文