在控制台输入mvn eclipse:eclipse
中途报错goal requires project to excute but there is no POM in this directory
出错原因是没有进到拥有pom.xml文件夹下进行操作 cd到相应的文件夹后再次输入mvn eclipse:eclipse即可
再不行在pom.xml里添加
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<additionalProjectnatures>
<projectnature>org.eclipse.jdt.core.javanature</projectnature>
<!--
<projectnature>org.eclipse.m2e.core.maven2Nature</projectnature>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
-->
</additionalProjectnatures>
<additionalBuildcommands>
<buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand>
<!--
<buildcommand>org.eclipse.m2e.core.maven2Builder</buildcommand>
<buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
-->
</additionalBuildcommands>
</configuration>
</plugin>
然后输入
mvn eclipse:clean
mvn eclipse:eclipse