Loading

Maven Error When Building Application Blocked Mirror for Repositories

Data pubblicazione: Nov 11, 2025
Risoluzione

SYMPTOM

The below MAven build failure occurs when building a Mule application:

[ERROR] Failed to execute goal on project test: Could not resolve dependencies for project xxx: 
Failed to collect dependencies at my.test:dependency:version -> my.test.transitive:transitive:version: 
Failed to read artifact descriptor for my.test.transitive:transitive:jar:version: 
Could not transfer artifact my.test.transitive:transitive:pom:version from/to maven-default-http-blocker (http://0.0.0.0/): 
Blocked mirror for repositories: [blocked-repository-id (http://blocked.repository.org, default, releases+snapshots)]

 

CAUSE

The latest versions of Apache Maven (3.8.1+) are blocking non HTTPS connections. So if an application pom.xml refers to a repository using HTTP instead of HTTPS it can get blocked with the error as seen above and the build will fail.
 

SOLUTION

According to Maven documentation in HTTP Repository Blocked one can take one of the following options:

  1. Upgrade the Maven repository so that it uses an HTTPS repository URL instead of the obsolete HTTP one.
    Example:
    <settings>
      ...
      <repositories>
        ...
        <repository>
          <id>mulesoft-release</id>
          <name>muleSoft release repository</name>
          <url>http://repository.mulesoft.org/releases/</url> ==> replace with HTTPS URL https://repository.mulesoft.org/releases/
          <layout>default</layout>
        </repository>
        ...
      </repositories>
      ...
    </settings>
    
  2. Define a mirror in your settings.
    Example:
    <settings>
      ...
      <mirrors>
        ...
        <mirror>
          <id>https-mirror</id>
          <name>HTTPS Mirror Repository for Mule</name>
          <url>https://repository.mulesoft.org/releases/</url>
          <mirrorOf>mulesoft-release</mirrorOf>
        </mirror>
        ...
      </mirrors>
      ...
    </settings>
    
  3. Define an exception for a specific repository.
    Example:
    <settings>
      ...
      <mirrors>
        ...
        <mirror>
          <id>my-repository-http-unblocker1</id>
          <mirrorOf>mulesoft-release</mirrorOf>
          <name></name>
          <url>http://repository.mulesoft.org/releases/</url>
          <blocked>false</blocked>
        </mirror>
        ...
      </mirrors>
      ...
    </settings>
    
    The <blocked>false</blocked> property will allow this HTTP repository to be used as an exception. 
    The <mirrorOf> and <url> properties are to be matched with the error log. The value of <mirrorOf> should be the blocked-repository-id.
Risorse aggiuntive

Apache Maven documentation for How to fix when I get a HTTP repository blocked?

Numero articolo Knowledge

001121394

 
Caricamento
Salesforce Help | Article