Maven build issue – Connection to repository refused

Most probably you are behind proxy.

Try to do a telnet repo.maven.apache.org 80 and probably you will find it failed to connect.

In your settings.xml, add corresponding proxy settings to tell Maven to go through the proxy to download the artifacts

<settings>
    .......
    <proxies>
        <proxy>
            <active>true</active>
            <protocol>http</protocol>
            <host>your_proxy_host</host>
            <port>your_proxy_port</port>
            <!--
            <username>proxyuser</username>
            <password>somepassword</password>
            <nonProxyHosts>*.yourdomain.com|*.yourOtherDomain.com</nonProxyHosts>
            -->
        </proxy>
    </proxies>
</settings>

Leave a Comment