Maven不是在eclipse中工作,而是在控制台中工作。为什么?

问题描述 投票:0回答:1

我有一个集成的maven eclipse插件(m2e)的问题。我正在使用eclipse氧气和maven 3.5.2。 Eclipse没有下载在项目的pom.xml中声明的任何依赖项,也没有构建任何项目。但是,如果我通过控制台命令构建项目,它正在正常工作!

首先我认为这是一个代理问题,但我在eclipse中配置了代理:

eclipse network connection dialog

我也试图改变“活跃的提供者”,但没有任何效果。

下一个尝试是将代理信息放在maven settings.xml中,甚至没有做到这一点。

我的settings.xml看起来像这样:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0                       
http://maven.apache.org/xsd/settings-1.0.0.xsd">

<proxies>
 <proxy>
   <id>msgProxy</id>
   <active>true</active>
   <protocol>http</protocol>
   <host>i.do.not.tell.you</host>
   <port>1234</port>
   <nonProxyHosts>localhost|127.0.0.1</nonProxyHosts>
 </proxy>
</proxies>
<profiles/>


</settings>

eclipse maven安装Dialoge,看起来像这样:

maven installation dialog

如果我尝试从原型创建新的Maven项目,则会显示以下错误消息:

Could not resolve archetype org.apache.maven.archetypes:maven-archetype-
webapp:1.0 from any of the configured repositories.
Could not resolve artifact org.apache.maven.archetypes:maven-archetype-
webapp:pom:1.0
Failure to transfer org.apache.maven.archetypes:maven-archetype-
webapp:pom:1.0 from https://repo.maven.apache.org/maven2 was cached in the 
local repository, resolution will not be reattempted until the update 
interval of central has elapsed or updates are forced. Original error: Could 
not transfer artifact org.apache.maven.archetypes:maven-archetype-
webapp:pom:1.0 from/to central (https://repo.maven.apache.org/maven2): 
connect timed out
Failure to transfer org.apache.maven.archetypes:maven-archetype-
webapp:pom:1.0 from https://repo.maven.apache.org/maven2 was cached in the 
local repository, resolution will not be reattempted until the update 
interval of central has elapsed or updates are forced. Original error: Could 
not transfer artifact org.apache.maven.archetypes:maven-archetype-
webapp:pom:1.0 from/to central (https://repo.maven.apache.org/maven2): 
connect timed out

error message in eclipse, while fetching maven archetypes

如果我开始更新项目,似乎maven需要永远下载的东西......

Long download process

你有什么建议留给我吗?如果是的话,我会非常感谢它。

提前致谢。

eclipse maven
1个回答
0
投票

我发现了这个问题。我们公司有自己的联系。所以,我将存储库添加到我的settings.xml中......问题解决了,感谢您的帮助

© www.soinside.com 2019 - 2024. All rights reserved.