How to disable maven blocking external HTTP repositores?

7

Maven blocks external HTTP repositories by default since version 3.8.1 (see https://maven.apache.org/docs/3.8.1/release-notes.html)

Is there a way to disable that or to exempt a repository from this rule?

Share
Improve this question
8
  • 1
    Are you in a corporate environment? If so configure a <mirrorOf>*</mirrorOf> and redirect to your internal repository manager? – khmarbaise Apr 8 at 11:40
  • @khmarbaise I found a solution (see my answer), where I explicitly configure a mirror for each blocked repository. With your solution, using a wildcard for mirrorOf, I could not distinguish between repositories, e.g. one for each snapshot and release. Or could I? – Sebu Apr 8 at 11:58
  • 1
    You can. See help.sonatype.com/repomanager3/formats/maven-repositories (settings.xml file)...The mirrorOf helps me to prevent to change something if I find a new repo... maintenance ... all request are redirected to repository manager which blocks already everything...Also I would never put a settings.xml in .mvn better use a config file provider plugin (Jenkins) to handle that incl. credentials.... Never allow repos being defined in a pom file... – khmarbaise Apr 8 at 12:09
  • @khmarbaise I see your point. I agree, this would be a better configuration. However, my situation is different and I need to work with what I've got. I have 20 projects, and in each pom file, the repositories are defined. And since the maven update to 3.8.1, all the builds fail, because the repositores are HTTP, not HTTPS. I use JFrog Artifactory as repo manager – Sebu Apr 8 at 13:54
  • This is a basic issue. You should change those pom files and clean them up... anything else is wrong...there are very good reason not to put any repo in a pom file..and use you repo manager it does not matter which one..the setup is more or less the same... – khmarbaise Apr 8 at 13:59

Comments

Popular posts from this blog

Meaning of `{}` for return expression

Get current scroll position of ScrollView in React Native

flutter websocket connection issue