构建错误 插件'org.apache.maven.plugins:maven-eclipse-plugin'不存在或找不到有效版本


Searching repository for plugin with prefix: 'eclipse'.
 org.apache.maven.plugins: checking for updates from central
NG] repository metadata for: 'org.apache.maven.plugins' could not be retrieved from repository: central due to an error: Error transferring file: Connection timed out: connect
 Repository 'central' will be blacklisted
 ------------------------------------------------------------------------
] BUILD ERROR
 ------------------------------------------------------------------------
 The plugin 'org.apache.maven.plugins:maven-eclipse-plugin' does not exist or no valid version could be found
 ------------------------------------------------------------------------
 For more information, run Maven with the -e switch
 ------------------------------------------------------------------------
 Total time: 22 seconds
 Finished at: Fri Aug 26 17:42:01 IST 2011
 Final Memory: 3M/15M

此问题可能是由于临时网络问题引起的。如果您打算将Maven与Eclipse一起使用,请不要使用maven-eclipse-plugin,而是使用m2e/m2eclipse Eclipse插件。这取决于您使用的是哪个版本的Eclipse;m2e是一个积极开发的版本,但只能在3.7 (Indigo)下工作,m2eclipse是3.6 (Helios)下工作的旧版本。

可能有以下几个原因:

  • Nicola之前提到的网络问题

如果插件实际存在于Maven存储库中,则

  • 存储库可以用不同版本的Maven创建
  • 有时存储库文件被损坏,解决方案可能是运行maven与-U开关
  • 如果以前的解决方案不起作用,尝试删除整个存储库并让Maven重新下载所有文件

最新更新