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?
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?
Although above answers are correct. I have observed that above option is not available on IntelliJ 2020.2 version. So, there you need to go Settings -> Build Tool -> Check "Reload projects after changes in the build scripts" -> check "Any changes"
Try adding an AppendingTransformer to your config. The example specifically mentions this as being useful for Spring handlers.
I'm not very familiar with maven-release-plugin, but I can see that there is a checkModificationExcludes property that you can use for your purpose. The config should be somewhat like this:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.2.2</version>
<configuration>
...
<checkModificationExcludes>
<checkModificationExclude>file_1</checkModificationExclude>
<checkModificationExclude>dir_1/file_2</checkModificationExclude>
</checkModificationExcludes>
</configuration>
</plugin>
You need to specify no_aop
as classifier like this:
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>3.0</version>
<classifier>no_aop</classifier>
</dependency>
I found a solution to do this by inspecting the commit in the Maven git repository that is responsible for the default HTTP blocking: https://github.com/apache/maven/commit/907d53ad3264718f66ff15e1363d76b07dd0c05f
My solution is as follows:
In the Maven settings (located in
${maven.home}/conf/settings.xml
or${user.home}/.m2/settings.xml
), the following entry must be removed:If you work in a project and cannot make sure the Maven settings are always like that, e.g. because you share code with other people or want to use CI/CD with automated testing, you may do the following: Add a directory named
.mvn
in the project. In the.mvn
directory, add a file namedmaven.config
with the content--settings ./.mvn/local-settings.xml
. In the.mvn
directory, add a file namedlocal-settings.xml
. This file should look like this:Where inside the
<mirrorOf>
tag, you need to specify what repository is blocked, and in the<url>
tag, you specify the original url of the repository again. You need to create this unblocker mirror for every repository you have that is blocked.Example:
If you have the following HTTP repositories defined in the
pom.xml
:Then you need in the
.mvn/local-settings.xml
:I hope my work can help other people who stumble upon this. However, if you have a more elegant or better solution, please share!