在Spring工程编译过程中遇到报错:Could not find artifact org.eclipse.m2e:lifecycle-mapping:pom:1.0.0
原因是pom文件中缺少依赖
解决办法:
将如下依赖加在pom文件中,在打开的pom文件右键open in terminal 在命令窗口执行执行mvn clean install 回车执行即可
4.0.0
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<packaging>maven-plugin</packaging>
<name>lifecycle-mapping Maven Dummy Plugin</name>
<description>Dummy Plugin, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=367870
and http://stackoverflow.com/questions/7905501/get-rid-of-pom-not-found-warning-for-org-eclipse-m2elifecycle-mapping/
</description>
<url>https://bugs.eclipse.org/bugs/show_bug.cgi?id=367870</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<goalPrefix>lifecycle-mapping</goalPrefix>
</configuration>
<executions>
<execution>
<id>generated-helpmojo</id>
<goals>
<goal>helpmojo</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.2</version>
</plugin>
</plugins>
</build>