Speed Up Maven Dependency Downloads in IDEA with Mirror Settings

This guide explains why Maven's default remote repository can be slow, shows how to configure fast Chinese mirrors such as Alibaba Cloud, NetEase, or Tencent Cloud, and demonstrates how to set these mirrors globally in IntelliJ IDEA so every new project downloads dependencies quickly.

Java Backend Technology
Java Backend Technology
Java Backend Technology
Speed Up Maven Dependency Downloads in IDEA with Mirror Settings

Maven Settings

By default Maven downloads dependencies from the remote central repository ( http://repo1.maven.org/maven2), which can be slow for users with poor network connections. Using a mirror such as Alibaba Cloud, NetEase, or Tencent Cloud can greatly improve download speed.

Configure the mirror by adding a <mirror> element to the settings.xml file, for example:

<mirror>
  <id>aliyunmaven</id>
  <mirrorOf>*</mirrorOf>
  <name>Alibaba Cloud Public Repository</name>
  <url>https://maven.aliyun.com/repository/public</url>
</mirror>

The settings.xml file is located at /Users/${user}/.m2/settings.xml on macOS and C:\Users\${user}\.m2\settings.xml on Windows. Copy your customized file to this location so every new Maven project uses the mirror automatically.

In IntelliJ IDEA you can also set a global Maven configuration for new projects via File | New Projects Settings | Settings/Preferences for New Projects (or File | Other Setting | Default Settings in older versions). After updating the Maven settings there and saving, all subsequently created projects will inherit the faster mirror configuration without further manual changes.

IDEA Maven default settings
IDEA Maven default settings
IDEA new project default settings
IDEA new project default settings
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Javadependency managementmavenbuild toolsIntelliJ IDEA
Java Backend Technology
Written by

Java Backend Technology

Focus on Java-related technologies: SSM, Spring ecosystem, microservices, MySQL, MyCat, clustering, distributed systems, middleware, Linux, networking, multithreading. Occasionally cover DevOps tools like Jenkins, Nexus, Docker, and ELK. Also share technical insights from time to time, committed to Java full-stack development!

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.