How to solve “Plugin execution not covered by lifecycle configuration” for Spring Data Maven Builds

前端 未结 30 2545
小蘑菇
小蘑菇 2020-11-21 15:10

I am trying to work with Spring Data and Neo4j. I started by trying to follow this guide linked to by the main site. In particular I based my pom.xml off of the \"Hello, Wor

相关标签:
30条回答
  • 2020-11-21 15:39

    I had the same problem with Eclipse v3.7 (Indigo) and m2eclipse as my Maven plugin. The error was easily solved by explicitly stating the execution phase within the plugin definition. So my pom looks like this:

    <project>
        ...
        <build>
            ...
            <plugins>
                <plugin>
    
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>buildnumber-maven-plugin</artifactId>
                    <version>1.0</version>
    
                    <configuration>
                        <timestampFormat>yyyy-MM-dd_HH-mm-ss</timestampFormat>
                    </configuration>
    
                    <executions>
                        <execution>
                            *<phase>post-clean</phase>*
                            <goals>
                                <goal>create-timestamp</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
            ...
    
    0 讨论(0)
  • 2020-11-21 15:42

    Note that the M2Eclipse (m2e) version 1.7.0 available in today's Eclipse Neon release train supports new syntax for specifying lifecycle mapping metadata. As a result boilerplate like this (here we're telling m2e to ignore the goal):

    <pluginManagement>
      <plugins>
        <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
        <plugin>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <versionRange>[1.5.0,)</versionRange>
                    <goals>
                      <goal>exec</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore></ignore>
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    

    can be replaced with a single line in the plugin's execution node:

    <?m2e ignore?>
    

    See the release notes for details.

    0 讨论(0)
  • 2020-11-21 15:43

    In Eclipse Luna 4.4.0, you can chose to ignore this error in preferences

    Window > Preferences > Maven > Errors/Warnings > Plugin execution not covered by lifecycle configuration. Select Ignore / Warning / Error as you wish.

    Also, in the quick fix (Ctrl + 1) for this error, it gives an option to mark goal as ignored in Eclipse build in Eclipse preferences (experimental)

    This is a cleaner way, as it doesn't modify your pom.xml.

    You will need to do a Maven > Update project to fix the same error in any other project as well.


    In STS(Spring-tool-suite), you can choose to ignore this error in preferences

    Window > Preferences > Maven > Errors/Warnings > Plugin execution not covered by life-cycle configuration. Select Ignore / Warning / Error as your wish. Then. Right click the project click Maven and update the project then error will gone.

    0 讨论(0)
  • 2020-11-21 15:43

    I encountered exact the same problem with maven thrift plugin. Here's my solution which requires no need to mess up your pom.xml:

    1. Use command line maven utility mvn

      mvn eclipse:eclipse

      to create a eclipse project

    2. Import the project in eclipse. Remember to use

      File > Import > General > Existing Projects into Workspace

      to add the project into your workspace.

    This should fix the problem.

    0 讨论(0)
  • 2020-11-21 15:44

    I got the same error. After doing the following it went away.

    1. Right click on the project.
    2. Select Maven > Update Project...
    0 讨论(0)
  • 2020-11-21 15:44

    I followed the GUI hint to finding any connector, and then I found AspectJ Integrator from SpringSource Team. After installation, it was settled.

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