Nexus Repo gives 503 with Maven but not with browser

前端 未结 4 916
我寻月下人不归
我寻月下人不归 2021-01-11 16:29

I just created a Nexus repo on a remote server. If I go to a browser on my local computer I see the pom file just fine. However, when I try mvn clean compile I see...

<
相关标签:
4条回答
  • 2021-01-11 16:34

    I struggled with this problem for ages; tried both answers to this question and also tried everything else I could find on the interwebs but to no avail.

    Then I changed the URLs in the distributionManagement section of the pom.xml. I used my PCs name instead of "localhost".

    As in: mypcname:8081/blahblah instead of localhost:8081/blahblah

    And it started to work miraculously.

    0 讨论(0)
  • 2021-01-11 16:38

    The problem is with your proxy settings. The current settings will cause all requests to localhost to go through the proxy which will not be able to connect with localhost and hence returns a 503.

    To solve this issue add the following to the proxy settings in the settings.xml file:
    localhost

    0 讨论(0)
  • 2021-01-11 16:39

    Problem was related to the proxy...

    When I configured the proxy in my Settings.xml it worked great for external sites, however, it screwed up internal sites (like my nexus repo). So I removed the proxy from my settings.xml, added it to my nexus server, and then mirrored the central repo to my nexus version of central repo.

    Now everything works as expected...

    0 讨论(0)
  • 2021-01-11 16:58

    I find this happens when I don't have proxies configured. If I add a broken proxy configuration that excludes everything I really access it works.

    <proxies>
        <proxy>
            <active>true</active>
            <protocol>http</protocol>
            <host>broken.com</host>
            <port>3128</port>
            <nonProxyHosts>mymaven|myotherrepo:8080|foo|baa</nonProxyHosts>
        </proxy>
    </proxies>
    

    Presumably maven is taking default proxy configuration from somewhere, but I have not found out where.

    0 讨论(0)
提交回复
热议问题