2012-03-15 105 views
5

MVN安装 我得到以下错误MVN安装错误再次

[ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its 
dependencies could not be resolved: Failed to read artifact descriptor for org. 
apache.maven.plugins:maven-resources-plugin:jar:2.5: Could not transfer artifact 
org.apache.maven.plugins:maven-resources-plugin:pom:2.5 from/to central (http:/ 
/repo.maven.apache.org/maven2): Connection to http://repo.maven.apache.org refus 
ed: Connection timed out: 

我试图设置代理服务器使用堆栈早期的答案,但我仍面临的问题。 需要明确的帮助。

+0

你是否支持代理? – khmarbaise 2012-03-15 12:39:07

回答

6

解决方案:

添加下面的依赖关系的pom.xml:

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

然后运行 ​​“命令mvn全新安装” 从命令提示符。

是刷新(F5)后,提升在Eclipse(运行>的Maven>更新项目配置。)

+2

没有帮我解决我的问题。 :( – Bouncner 2013-01-21 21:10:36

+0

@ Umasankar pardhan,我neithier :( – Israel 2013-04-30 02:27:21

1

添加一个全局的settings.xml(样本将提供你mvn.home/conf目录内/项目配置settings.xml中)在你的文件夹中的.m2,驻留在内部c:/user/username/.m2 .. 添加在settings.xml以下条目中

<pluginRepositories> 

            <pluginRepository> 
              <id>central</id> 
              <name>Maven Plugin Repository</name> 
              <url>http://repo1.maven.org/maven2</url> 
              <releases> 
                <enabled>false</enabled> 
              </releases> 
              <snapshots> 
                <enabled>false</enabled> 
              </snapshots> 
            </pluginRepository> 

          </pluginRepositories> 

这样就解决了上述问题。

2

面临同样的问题。这是因为缓存的文件。我的工作是删除存储库文件夹的内容。它在下一次构建中再次下载了所有文件,但解决了这个问题。

0

我有代理设置造成的相同问题。我解决它添加在位于Maven安装目录下的文件setting.xml我的代理服务器设置在/conf/settings.xml

<proxies> 
    <proxy> 
     <id>optional</id> 
     <active>true</active> 
     <protocol>http</protocol> 
     <username>xxxx</username> 
     <password>xxxxx</password> 
     <host>xxxxxxx</host> 
     <port>xxxx</port> 
     <nonProxyHosts>local.net|some.host.com</nonProxyHosts> 
    </proxy> 
</proxies> 
-1

在Eclipse中去窗口 - >首选项 - >的Maven - > 取消选中选项“不要自动更新从远程存储库的依赖关系“

这样做已经为我做了窍门。那时我可以下载所有的依赖关系。

0

我通过在我

的settings.xml

文件中以下行可我们C:\Program Files\Apache\maven\apache-maven-3.3.9\conf

<proxies> 
<proxy> 
    <id>optional</id> 
    <active>true</active> 
    <protocol>https</protocol> 
    <host>xxxxxxxxxx</host> 
    <port>xxxx</port> 
    <nonProxyHosts>local.net|some.host.com</nonProxyHosts> 
</proxy> 

请注意与协议中解决了这个问题“https”不是“http”。保存此文件,并通过导航到

Windows的>首选项> Maven->用户设置 - >用户设置更新IDE的用户设置

C:\Program Files\Apache\maven\apache-maven-3.3.9\conf\settings.xml 

希望这有助于。