Setup Maven plugin connectors Error

后端 未结 2 629
眼角桃花
眼角桃花 2021-01-24 04:57

I am trying to import a project into Spring Source Tool Suite (latest version).

The project was previously created from maven archetype cataloge.

I am getting

相关标签:
2条回答
  • 2021-01-24 05:03

    I ran into this issue as well. I found the problem was that my project required an older version of Maven than what came installed with eclipse.

    In my case, eclipse came with version 3.3.3 installed. I needed version 3.0.5

    I downloaded and installed the appropriate version of maven I needed and added it to eclipse by going to: preferences > maven > installations.

    When you build, if you're building through eclipse, make sure to select the correct version of maven. You should have two to choose from now. Run as -> Maven Build... -> Maven Runtime: *select the proper version*

    0 讨论(0)
  • 2021-01-24 05:15

    Your error has nothing to do with the project or the maven configuration. It has to do with the fact that the new versions of Eclipse have the M2E (previously known as M2Eclipse) project built into it now.

    The new version has been improved so that as it imports your Maven project it reads the pom and properly sets up the Eclipse project. To do this it needs various connectors, most of which are already available and configured to do the Right Thing. However, your plugin executions have not been pre-configured and so you need to tell M2E what you want to have happen when Eclipse does a Maven build.

    For me, I configured M2E to "ignore" these executions by adding the following to BuildManagement:

                <plugin>
                    <!--This plugin's configuration is used to store Eclipse m2e settings 
                        only. It has no influence on the Maven build itself. -->
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.apache.maven.plugins</groupId>
                                        <artifactId>maven-dependency-plugin</artifactId>
                                        <versionRange>[1.0,)</versionRange>
                                        <goals>
                                            <goal>copy-dependencies</goal>
                                            <goal>unpack</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.codehaus.mojo</groupId>
                                        <artifactId>hibernate3-maven-plugin</artifactId>
                                        <versionRange>[2.2,)</versionRange>
                                        <goals>
                                            <goal>hbm2ddl</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.sonatype.flexmojos</groupId>
                                        <artifactId>flexmojos-maven-plugin</artifactId>
                                        <versionRange>[4.0-RC2,)</versionRange>
                                        <goals>
                                            <goal>compile-swc</goal>
                                            <goal>compile-swf</goal>
                                            <goal>copy-flex-resources</goal>
                                            <goal>generate</goal>
                                            <goal>test-compile</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
    

    Read all about it here:

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

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