我想用Maven模板jersey-quickstart-webapp
创建一个Java Restful WebService。
我遇到以下错误:
Could not resolve archetype org.glassfish.jersey.archetypes:jersey-quickstart-webapp:2.23.1 from any of the configured repositories.
Could not resolve artifact org.glassfish.jersey.archetypes:jersey-quickstart-webapp:pom:2.23.1
Could not transfer artifact org.glassfish.jersey.archetypes:jersey-quickstart-webapp:pom:2.23.1 from/to central (https://repo.maven.apache.org/maven2): connect timed out
Could not transfer artifact org.glassfish.jersey.archetypes:jersey-quickstart-webapp:pom:2.23.1 from/to central (https://repo.maven.apache.org/maven2): connect timed out
我正在使用Eclipse Luna,最新版本。
答案 0 :(得分:0)
您必须在settings.xml中配置代理
<proxies>
<proxy>
<id>example-proxy</id>
<active>true</active>
<protocol>http</protocol>
<host>proxy.example.com</host>
<port>8080</port>
<username>proxyuser</username>
<password>somepassword</password>
<nonProxyHosts>www.google.com|*.example.com</nonProxyHosts>
</proxy>
</proxies>
https://maven.apache.org/guides/mini/guide-proxies.html
如果仍然无效,可能无法从您的网络中访问Maven Central。然后,您只能要求管理员取消阻止或在公司存储库中镜像它。