问题描述
访问位于本地主机中的本地nexus存储库时,返回码为502.
While accessing local nexus repository which is in local host the return code is 502.
pom.xml看起来像这样
pom.xml looks something like this
<repositories>
<repository>
<id>nexus</id>
<name>nexusPublic</name>
<url>http://localhost:8081/nexus/content/groups/public/</url>
</repository>
</repositories>
推荐答案
致OP和任何可能通过google到达这里的人(就像我一样):
To OP and anyone who may have got here through google (just like me):
我遇到了同样的问题,我输入的项目使用了服务器上存储库中的一些工件(通过Archiva).我可以通过浏览器访问jar,但是Maven找不到它.
I had the same issue, the project I entered used some artifact from the repository on our server (via Archiva). I was able to reach the jar from browser, but Maven was not able to find it.
问题是我的公司使用代理,并且无法通过其自己的代理连接到公司的服务器.我在我的Maven配置(.m2/settings.xml)中添加了<nonProxyHosts>servername.dev.company.com</nonProxyHosts>
.根据此答案,在您的情况下为<nonProxyHosts>*localhost*</nonProxyHosts>
.
The problem was that my company uses proxy and it was impossible to connect to company's server through it's own proxy. I added <nonProxyHosts>servername.dev.company.com</nonProxyHosts>
to my Maven configuration (.m2/settings.xml).According to this answer, in your case it would be <nonProxyHosts>*localhost*</nonProxyHosts>
.
这篇关于mave 3.2无法访问本地关系实例返回502代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!