【发布时间】:2016-01-29 05:47:50
【问题描述】:
您好,我无法在我的机器中创建 Maven 项目。以下是我的配置
Eclipse Version: Mars.1 Release (4.5.1)
Maven Version: m2e, Maven Integration for Eclipse, 1.6.2
我支持公司代理。我试图在 .m2 目录中配置设置文件,但它不起作用。下面是我的设置文件
<?xml version="1.0" encoding="UTF-8"?>
<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>myproxy</id>
<active>true</active>
<protocol>http</protocol>
<host>XX.XX.XX.XX</host>
<port>8080</port>
<nonProxyHosts></nonProxyHosts>
<username>USERNAME</username>
<password>PASSWORD</password>
</proxy>
</proxies>
</settings>
我在 StackOverflow 中看到了很多关于这个问题的答案,我试过了,但没有任何效果。我怀疑,我的密码中有'@'字符,它会导致任何问题吗?我们还需要提供 USERNAME 作为 domain\USERNAME 还是只提供 USERNAME ?以及如何在文件中同时提供http和https?
堆栈跟踪错误
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
【问题讨论】:
-
你能分享一个堆栈跟踪或错误吗?您是否尝试在 CDATA 块中添加密码?示例:
<![CDATA[password]]> -
添加了堆栈跟踪错误。
-
我遇到了同样的问题。参考这个答案stackoverflow.com/a/41395286/3141502