java - 如何让maven优先使用用户setting.xml的配置?
黄舟
黄舟 2017-04-18 10:46:49
0
3
603
黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(3)
迷茫

It is settings.xml not setting.xml, so your user configuration does not take effect

大家讲道理

Are you using maven in combination with the IDE or alone? Maybe your settings in the IDE have not been changed

小葫芦

@FullStackDeveloper You are right. The setting.xml in the question is written incorrectly. I actually have settings.xml in the directory. Because I copied the file in the compressed package, the file name is not wrong. Thank you very much for reminding.

@Ruoxi Xiangyan is used in IDEA. Which configuration file is used can be independently configured in IDEA. If not selected, user configuration takes priority by default.

Finally, I found the cause of the problem as follows:
Use the command mvn help:system directly in the terminal to observe the reading of the configuration.
%USERPROFILE% points to the user directory under the C drive, but I accidentally discovered that there is also a user directory under the D drive, and there is also an .m2 directory in this user directory. I thought I was going to the user directory under the C drive, but actually I was going to the user directory under the D drive.
So no matter how I modify the configuration under C drive, it has no effect.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template