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.
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.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
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!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
