7

Things worked fine in 2021.2 but when same project opened in 2021.3 then stated to got following error

http://0.0.0.0/ during a previous attempt. This failure was cached in the local repository and resolution will not be reattempted until the update interval of maven-default-http-blocker has elapsed or updates are forced. Original error: Could not transfer metadata com.domain.sub-domain.project:private-commons:1.0.0-SNAPSHOT/maven-metadata.xml from/to maven-default-http-blocker (http://0.0.0.0/): transfer failed for http://0.0.0.0/com/domain/sub-domain/project/private-repo/1.0.0-SNAPSHOT/maven-metadata.xml
Cannot resolve junit:junit:4.12
Cannot resolve org.apache.camel:camel-test:2.23.0
Cannot resolve com.amazonaws:aws-java-sdk-glacier:1.11.415

screen shoot

Rajat
  • 2,467
  • 2
  • 29
  • 38

1 Answers1

16

2021.3 IDE version has updated the version of the bundled Maven to 3.8.1. In this version, Maven blocks the access to http repositories by default. Before that, Maven itself has moved from using the http repositories.

So now one needs to explicitly configure Maven to allow http repositories if they are used in the project. E.g. in settings.xml add a mirror to your http repository that allows HTTP:

<mirrors>
    <mirror>
        <id>my-repo-mirror</id>
        <name>My Repo HTTP Mirror</name>
        <url>http://url-to.my/repo</url>
        <mirrorOf>my-repo</mirrorOf>
    </mirror>
</mirrors>

You can also check the related discussion at https://stackoverflow.com/a/67002852/2000323 for ways to configure it.

Another option is to specify older Maven version in IDE: Settings (Preferences on macOS) | Build, Execution, Deployment | Build Tools | Maven | Maven home path.

Rajat
  • 2,467
  • 2
  • 29
  • 38
Andrey
  • 15,144
  • 25
  • 91
  • 187
  • This is important information. The discarding of a given repository could be reported much better though. – Thorbjørn Ravn Andersen Dec 06 '21 at 12:35
  • @Thorbjørn Ravn Andersen in next IDE versions we will add detection of such cases with possible quick fix suggestions about how to fix this. – Andrey Dec 17 '21 at 08:17
  • @Andrey I was thinking of Mavens own reporting. If intellij can be more informative thats even better. – Thorbjørn Ravn Andersen Dec 17 '21 at 08:42
  • 3
    for me just change Settings (Preferences on macOS) | Build, Execution, Deployment | Build Tools | Maven | **Maven home path** to **User Maven Wrapper** – ychz Feb 21 '22 at 17:39
  • Every time I upgrade the IntelliJ version it deletes all the settings, I have 16 projects, and I must reconfigure after every upgrade. IntelliJ is not so intelligent after all! – Sandeep Kumar Dec 02 '22 at 21:07