TECHIES WORLD

For Techs.... Techniques.... Technologies....

BashLinux

Maven Error: Could not transfer from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories

Could not transfer from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories

This error happens because of the insecure repositories. i.e. http instead of https. Maven disallows the insecure repositories by default.

If the repository is trusted, we can configure Maven to allow the connections through http.

Step1: Open Maven settings file.

#vi ~/.m2/settings.xml

Step2: Add the repositoy url in the following format and save.

<mirror>
    <id>insecure-repo</id>
    <mirrorOf>external:http:*</mirrorOf>
    <url>URL</url>
    <blocked>false</blocked>
</mirror>

Where URL need to be replaced with the link to the repository that required to whitelist.

That's all…