2017-05-23 139 views
0

我只是试图在STS中创建一个新的Maven项目(只是骨架),并直接抛出错误。我没有做或修改任何东西,它只是抛出错误,当我创建项目,并且POM显示错误。我对Maven非常陌生,尝试了在讨论板上讨论的多个选项,但没有任何帮助。Maven项目抛出错误

错误:

Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6 
Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6 

POM:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>com.springboot.apidemo</groupId> 
    <artifactId>springboot-demo-api</artifactId> 
    <version>0.0.1-SNAPSHOT</version> 
    <name>SPring Boot API Demo</name> 
</project> 

选项尝试:

  • 删除回购从.m2目录/
  • 试图指向由安装在Eclipse中我的系统行家3.5 'maven下的安装'
  • 试图声明插件的POM
  • 试图声明依赖于POM
  • 夹Setting.xml几乎是空的(我刚刚从Maven的conf目录拷贝,并没有触及这一点)。
在POM

新增依赖性:

Errors occurred during the build. 
Errors running builder 'Maven Project Builder' on project 'springboot-demo-api'. 
Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6 
Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6 
Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6 
Plugin 

我不担心任何功能,只需创建一个新的Maven凸出从日食:

<dependency> 
    <groupId>org.apache.maven.plugins</groupId> 
    <artifactId>maven-resources-plugin</artifactId> 
    <version>2.6</version> 
</dependency> 

错误POM这种依赖性更新后本身抛出的错误是什么让我困扰。

有人可以对此有所了解吗?

回答

0

您可能未连接到MavenCentral。两个主要原因:您的settings.xml错误,或者您居住在代理后面,以致无法访问。

0

我已经做了一切正确的事情,它也能够连接到Maven-central,但这里的缓存是我的机器中有一个防火墙阻止jar下载。

当我尝试下载文件时,我可以直接下载zip文件,但不能直接下载jar文件,这是我的程序失败的地方。

'代理人'这个词帮助我以一种不同于我整天在做的方式来思考。 它已经解决,我已经做了很多编码成功。 谢谢你的帮助。