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

前端 未结 30 2547
小蘑菇
小蘑菇 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:45

    Use m2e 0.12, last version from Sonatype.

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

    Goto workspace/rtc-ws/.metadata/.plugins/org.eclipse.m2e.core/lifecycle-mapping-metadata.xml then create lifecycle-mapping-metadata.xml file and paste below and reload configuration as below

    If you are using Eclipse 4.2 and have troubles with mapping and won't put mess into yours pom.xml create new file lifecycle-mapping-metadata.xml configure it in Windows -> Preferences -> Lifecycle mapping (don't forget press Reload workspace lifecycle mappings metadata after each change of this file!). Here is example based on eclipse/plugins/org.eclipse.m2e.lifecyclemapping.defaults_1.2.0.20120903-1050.jar/lifecycle-mapping-metadata.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <lifecycleMappingMetadata>
        <pluginExecutions>
            <pluginExecution>
                <pluginExecutionFilter>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>buildnumber-maven-plugin</artifactId>
                    <goals>
                        <goal>create-timestamp</goal>
                    </goals>
                    <versionRange>[0.0,)</versionRange>
                </pluginExecutionFilter>
                <action>
                    <ignore />
                </action>
            </pluginExecution>
    
            <pluginExecution>
                <pluginExecutionFilter>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <goals>
                        <goal>list</goal>
                    </goals>
                    <versionRange>[0.0,)</versionRange>
                </pluginExecutionFilter>
                <action>
                    <ignore />
                </action>
            </pluginExecution>
    
            <pluginExecution>
                <pluginExecutionFilter>
                    <groupId>org.zeroturnaround</groupId>
                    <artifactId>jrebel-maven-plugin</artifactId>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                    <versionRange>[0.0,)</versionRange>
                </pluginExecutionFilter>
                <action>
                    <ignore />
                </action>
            </pluginExecution>
    
            <pluginExecution>
                <pluginExecutionFilter>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>gwt-maven-plugin</artifactId>
                    <goals>
                        <goal>compile</goal>
                    </goals>
                    <versionRange>[0.0,)</versionRange>
                </pluginExecutionFilter>
                <action>
                    <ignore />
                </action>
            </pluginExecution>
    
            <pluginExecution>
                <pluginExecutionFilter>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <goals>
                        <goal>copy-dependencies</goal>
                        <goal>unpack</goal>
                    </goals>
                    <versionRange>[0.0,)</versionRange>
                </pluginExecutionFilter>
                <action>
                    <ignore />
                </action>
            </pluginExecution>
    
            <pluginExecution>
                <pluginExecutionFilter>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <versionRange>[1.7,)</versionRange>
                    <goals>
                        <goal>run</goal>
                    </goals>
                </pluginExecutionFilter>
                <action>
                    <ignore />
                </action>
            </pluginExecution>
    
    
            <pluginExecution>
                <pluginExecutionFilter>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <versionRange>[2.8,)</versionRange>
                    <goals>
                        <goal>check</goal>
                    </goals>
                </pluginExecutionFilter>
                <action>
                    <ignore />
                </action>
            </pluginExecution>
    
        </pluginExecutions>
    </lifecycleMappingMetadata>
    
    0 讨论(0)
  • 2020-11-21 15:50

    I had this problem today. I was using STS 3.4 with its bundled Roo 1.2.4. Later I tried with Eclipse Kepler and Roo 1.2.5, same error.

    I've changed my pom.xml adding pluginTemplates tag after build and before plugins declaration but didn't work.

    What made the magic for me:

    • Using jdk 1.7.0_51
    • Downloaded Roo 1.2.5
    • Downloaded Maven 3.2.1 (if not, when executes "perform eclipse" this error appears "error=2, no such file or directory")
    • Configured JDK, Roo and Maven bin directories on my PATH:

      export PATH=/opt/jdk1.7.0_51/bin:$PATH export PATH=/opt/spring-roo-1.2.5.RELEASE/bin:$PATH export PATH=/opt/apache-maven-3.2.1/bin:$PATH

    Made my configuration as following: (http://docs.spring.io/spring-roo/reference/html/beginning.html)

    $ mkdir hello 
    $ cd hello
    $ roo.sh
    roo> project --topLevelPackage com.foo
    roo> jpa setup --provider HIBERNATE --database HYPERSONIC_PERSISTENT 
    roo> web mvc setup
    roo> perform eclipse
    

    Open with Eclipse (nothing of STS, but I guess it works): Import -> Existing Projects into Workspace

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

    I was using

    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-antrun-plugin</artifactId>
    <version>1.6</version>
    <executions>
        <execution>
            <id>runSomeAntTasks</id>
            <phase>test-compile</phase>
            .
            .
            <goals>
                <goal>run</goal>
            </goals>
        </execution>
    </executions>
    

    and changed it to

    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-antrun-plugin</artifactId>
    <version>1.6</version>
    <executions>
    <execution>
        <id>runSomeAntTasks</id>
        <phase>integration-test</phase>
            .
            .
    
            <goals>
                <goal>run</goal>
            </goals>
        </execution>
    </executions>
    

    and the error went away. Maybe it's not recommended to bind an execution to the test-compile phase so finding a different phase might be an alternate solution to adding plugin-management configuration to the maven lifecycle.

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

    Instead of messing up your pom file, I would suggest you to go to Show ViewMarkers in Eclipse, select and delete the markers of appropriate errors.

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

    I fixed it following blog post Upgrading Maven integration for SpringSource Tool Suite 2.8.0.

    Follow the advice on the section called "Uh oh…my projects no longer build". Even when it's intended for SpringSource Tool Suite I used it to fix a regular Eclipse installation. I didn't have to modify my pom files.

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