generating Eclipse project files with Maven

对着背影说爱祢 提交于 2019-12-02 22:57:55

Either use the fully qualified name of the plugin to specify the version:

$ mvn org.apache.maven.plugins:maven-eclipse-plugin:2.8:eclipse

Or edit the ~/.m2/plugin-registry.xml file (for advanced users, make a backup).

Or try the -npr,--no-plugin-registry options to tell maven to not use ~/.m2/plugin-registry.xml for plugin versions:

$ mvn -npr eclipse:eclipse

But I don't guarantee a successful result. See the Introduction to the Plugin Registry for more details.

Or remove the version 2.9-SNAPSHOT from your local repository:

$ rm -rf ~/.m2/repository/org/apache/maven/plugins/maven-eclipse-plugin/2.9-SNAPSHOT

Unfortunately the problem still persists and the selected answer did not help me, as Maven always wanted to fetch the newest version available, which is the faulty 2.9-SNAPSHOT.

I had to manually specify the working version 2.8 in my POM, like so:

<plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-eclipse-plugin</artifactId>
   <version>2.8</version>
   <configuration>
...

The solutions mentioned in the accepted answer does not seems to work. Using no plugin registry, it always tries to use the latest version, and re-download it you try to delete it.

I solved the problem by updating the file

.m2/repository/org/apache/maven/plugins/maven-eclipse-plugin/maven-metadata-central.xml

You're not supposed to edit this file, but if it was using the 2.9-SNAP instead of 2.9, it probably means that this file specified 2.9-SNAP at the latest instead of the 2.9

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!