The .m2 file does not appear in the installation of maven [How to Solve]

settings.xml exists in two places:
1. Installation place: $M2_HOME/conf/settings.xml

2. User’s directory: ${user.home}/.m2/settings.xml

The former is also called global configuration, and the latter is called user configuration. If both exist, their contents will be merged, and user-scoped settings.xml takes precedence.

If you occasionally need to create user-scoped settings, you can simply copy the settings from the Maven installation path to the directory ${user.home}/.m2. The default settings.xml of Maven is a template that contains comments and examples.

It is found that the default setting configuration of many third-party projects is the user directory/.m2/settings.xml

So for convenience, you need to create the .m2 folder yourself and configure settings.xml in it

The online tutorial is to use the command

mvn help:system

After using it, it was found that the .m2 folder was not generated

After searching a lot, I found that the local storage in the default maven must be set as the default, that is, do not set

This line is commented or uncommented, and then execute the mvn help:system command.

Similar Posts:

Leave a Reply

Your email address will not be published. Required fields are marked *