Solve the problem that the Maven home directory of the local warehouse becomes the default path after reopening IDEA

Solve the problem that the Maven home directory of the local warehouse becomes the default path after reopening IDEA. Write the custom directory title here

Problem Description

Every time a new Maven project is created, the Maven home directory will become the default path, and you cannot use your own local warehouse path
Idea configuration default Maven path

problem analysis

Idea writes the default configuration into the configuration file, and reads the default settings from the configuration file every time a new project is created. So you need to modify the default configuration file

Solution

Modify project.default.xml, file path

C:\Users\你的用户名.IntelliJIdea2019.3\config\option\project.default.xml

Open the file and modify the following content to solve

<component name="MavenImportPreferences">
    <option name="generalSettings">
        <MavenGeneralSettings>
            <option name="localRepository" value="这里是你自己的local repository路径,例如(C:\ideaMaven\MavenRepository)" />
            <option name="mavenHome" value="这里是你自己的maven Home路径,例如(C:\ideaMaven\apache-maven-3.6.1)" />
            <option name="userSettingsFile" value="这里是你自己的user Settings File路径,例如(C:\ideaMaven\apache-maven-3.6.1\conf\settings.xml)" />
        </MavenGeneralSettings>
    </option>
</component>

To create a new Maven project in the future, the local warehouse will be used.

Guess you like

Origin blog.csdn.net/Evain_Wang/article/details/108860817