Configuring Apache Maven for Spring Boot Development in IntelliJ IDEA

Installing Apache Maven

Acquire the binary distribution from the official Apache Maven website and extract the archive contents to a dedicated directory on your system. For this demonstration, we assume the extraction path is D:\dev_tools\apache-maven.

System Environment Setup

To execute Maven commands from any terminal location, configure the environment variables:

  1. Create a new system variable named MAVEN_HOME and assign the value of your installation directory.
  2. Edit the system Path variable and append the Maven binary directory:
    %MAVEN_HOME%\bin

Validate the configuration by opening a command prompt and executing the version check:

mvn --version

Maven Configuration

Navigate to the conf directory inside your installation folder and open the settings.xml file. This file controls repository behavior and storage locations.

Local Repository Path

Define a specific location for storing downloaded artifacts to avoid using the default user home directory. Insert the following XML tag:

<localRepository>D:/maven_storage</localRepository>

Remote Repository Mirrors

To improve dependency download speeds, configure mirrors within the <mirrors> section. The following example configures the Aliyun cloud repository:

<mirrors>
    <mirror>
        <id>aliyun-public</id>
        <name>Aliyun Public Repository</name>
        <url>https://maven.aliyun.com/repository/public</url>
        <mirrorOf>central</mirrorOf>
    </mirror>
    <mirror>
        <id>aliyun-spring-plugin</id>
        <name>Aliyun Spring Plugin Repository</name>
        <url>https://maven.aliyun.com/repository/spring-plugin</url>
        <mirrorOf>central</mirrorOf>
    </mirror>
    <mirror>
        <id>spring-milestones</id>
        <mirrorOf>central</mirrorOf>
        <name>Spring Milestones</name>
        <url>https://repo.spring.io/milestone</url>
    </mirror>
</mirrors>

IntelliJ IDEA Integration

Link the configured Maven installation to the IDE:

  1. Open File > Settings > Build, Execution, Deployment > Build Tools > Maven.
  2. Set the Maven home path to your extracted directory:
    D:\dev_tools\apache-maven
  3. Update the User settings file path:
    D:\dev_tools\apache-maven\conf\settings.xml
  4. Verify that the Local repository field automatically detects the path specified in settings.xml (e.g., D:/maven_storage).

Tags: java Spring Boot Maven IntelliJ IDEA configuration

Posted on Sat, 24 Oct 2026 16:45:54 +0000 by TabLeft