使用Maven生成Eclipse项目文件 [英] generating Eclipse project files with Maven
问题描述
当我尝试使用 mvn eclipse:eclipse
生成Eclipse项目文件时,我收到以下错误:
When I try and generate the Eclipse project files using mvn eclipse:eclipse
I get the following error:
插件管理器执行目标中的内部错误
'org.apache.maven.plugins:maven-eclipse-plugin:2.9-SNAPSHOT:eclipse':无法加载mojo
'org.apache.maven.plugins:maven-eclipse-plugin:2.9-SNAPSHOT:eclipse'
在插件'org
.apache.maven.plugins:maven-eclipse-plugin'中。
缺少必需的类:
org / codehaus / plexus / resource / loader / ResourceNotFoundException
Internal error in the plugin manager executing goal 'org.apache.maven.plugins:maven-eclipse-plugin:2.9-SNAPSHOT:eclipse': Unable to load the mojo 'org.apache.maven.plugins:maven-eclipse-plugin:2.9-SNAPSHOT:eclipse' in the plugin 'org .apache.maven.plugins:maven-eclipse-plugin'. A required class is missing: org/codehaus/plexus/resource/loader/ResourceNotFoundException
我使用版本2.9-SNAPSHOT的Maven Eclipse插件。我的猜测是这个版本的插件有一个bug,如果我使用一个稳定版本(而不是一个快照),这个问题就会被解决。有没有办法改变我使用的这个插件的版本,或者这个问题与Eclipse插件的版本无关?
It appears that I'm using version 2.9-SNAPSHOT of the Maven Eclipse plugin. My guess is that there is a bug in this version of the plugin and if I use a stable release (instead of a snapshot), the problem will be resolved. Is there a way that I can change the version of this plugin I'm using, or is this problem unrelated to the version of the Eclipse plugin?
推荐答案
使用插件的完全限定名称来指定版本:
Either use the fully qualified name of the plugin to specify the version:
$ mvn org.apache.maven.plugins:maven-eclipse-plugin:2.8:eclipse
或编辑〜/ .m2 / plugin-registry.xml
文件(对于高级用户进行备份)。
Or edit the ~/.m2/plugin-registry.xml
file (for advanced users, make a backup).
或尝试 -npr, - no-plugin-registry
选项来告诉maven不要使用〜/ .m2 / plugin-registry.xml
对于插件版本:
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.
或从本地存储库中删除 2.9-SNAPSHOT
的版本:
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
这篇关于使用Maven生成Eclipse项目文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!