Skip to content

Instantly share code, notes, and snippets.

@vegaasen
Last active April 29, 2024 01:40
Show Gist options
  • Save vegaasen/1d545aafeda867fcb48ae3f6cd8fd7c7 to your computer and use it in GitHub Desktop.
Save vegaasen/1d545aafeda867fcb48ae3f6cd8fd7c7 to your computer and use it in GitHub Desktop.
Maven 3.8.1 blocked mirror for internal repositories

Maven 3.8.1 blocked mirrors "fix"

This is not a fix, but a workaround for repositories not on HTTPS yet. Use with caution.

Error

[ERROR] (...) Could not transfer artifact no.whatever:whatever-client:pom:3.1 from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [releases (http://unportected.com/nexus/content/repositories/releases, defaul)] -> [Help 1]

"Fix"

Put this section in your ~/.m2/settings.xml-file, and rerun mvn with -U option. U're done ✅.

<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 http://maven.apache.org/xsd/settings-1.2.0.xsd">
  ...
    <mirrors>
        <mirror>
            <id>maven-default-http-blocker</id>
            <mirrorOf>external:dont-match-anything-mate:*</mirrorOf>
            <name>Pseudo repository to mirror external repositories initially using HTTP.</name>
            <url>http://0.0.0.0/</url>
            <blocked>false</blocked>
        </mirror>
    </mirrors>
  ...
</settings>
@ConnorChen97
Copy link

thx, v3.9.0 workds

@chanjarster
Copy link

great!!!

@shubhamsharma24
Copy link

thanks, worked like a charm

@yuyol
Copy link

yuyol commented Apr 18, 2023

Thanks!!! It works for me

@babagay
Copy link

babagay commented Jul 4, 2023

Работает

@raylax
Copy link

raylax commented Dec 26, 2023

thx, 3.9.2

@JhonwillBao
Copy link

it worked,thx a lot

@Marlon0714
Copy link

It worked!, Thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment