Eclipse loops endlessly: Invoking 'Maven Project Builder'

后端 未结 18 772
遇见更好的自我
遇见更好的自我 2021-02-02 05:56

Ugh! My Eclipse is stuck in an endless loop:

  • No operations to display at this time
  • Refreshing Workspace Building
  • Workspace. Invoking \'Maven Pro
相关标签:
18条回答
  • 2021-02-02 06:19

    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.

    0 讨论(0)
  • 2021-02-02 06:22
    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.

    0 讨论(0)
  • 2021-02-02 06:24

    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.

    0 讨论(0)
  • 2021-02-02 06:24

    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.

    0 讨论(0)
  • 2021-02-02 06:27

    I opened my module's .project file. There were two redundant entries and deleting one helped

    <buildCommand>
        <name>org.eclipse.m2e.core.maven2Builder</name>
        <arguments>
        </arguments>
    </buildCommand>
    <buildCommand>
        <name>org.eclipse.m2e.core.maven2Builder</name>
        <arguments>
        </arguments>
    </buildCommand>
    
    0 讨论(0)
  • 2021-02-02 06:28

    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/

    0 讨论(0)
提交回复
热议问题