简体   繁体   English

本地Maven存储库位置

[英]Local maven repository location

I installed Maven 3.3 using mac's brew tool. 我使用Mac的brew工具安装了Maven 3.3。 I am not able to find the location of the .m2 folder. 我找不到.m2文件夹的位置。 Please help me finding that folder. 请帮助我找到该文件夹​​。

I ran the following command to install Maven: 我运行以下命令来安装Maven:

brew install maven@3.3

Edit : 编辑

Where is my m2 folder on Mac OS X Mavericks In the above link it is mentioned, I have to manually create .m2 folder. 在Mac OS X Mavericks上,我的m2文件夹在哪里?在上面的链接中,我不得不手动创建.m2文件夹。 But, ideally it should be automatically created like in ubuntu, right? 但是,理想情况下应该像在ubuntu中一样自动创建它,对吗?

if you are using ubuntu then you can find .m2 (hidden folder) folder into home directory. 如果您正在使用ubuntu,则可以在home目录中找到.m2 (隐藏文件夹)文件夹。 path : /home/username/.m2 路径:/home/username/.m2

if you are using Windows system, then .m2 folder is expected to be located under ${user.home}. 如果使用的是Windows系统,则.m2文件夹应位于$ {user.home}下。 On Windows 7 , 8, 10 this resolves to \\Users\\. 在Windows 7、8、10上,此解析为\\ Users \\。 So you'd normally see it under c:\\Users\\maven.m2. 因此,通常您可以在c:\\ Users \\ maven.m2下看到它。 .

Maven create automaticaly the .m2 folder : Maven自动创建.m2文件夹:

It's in your home foldder , you didn't see it coz it's hidden by default . 它在您的家用文件夹中,您没有看到它,因为默认情况下它是隐藏的。

you can tape those cmd tu make it visible : 您可以用胶带贴上这些cmd tu使其可见:

> mv ~/.m2 ~/m2
> ln -s ~/m2 ~/.m2   

If used brew to install maven, create .m2 directory and then copy settings.xml in .m2 directory. 如果使用brew安装maven,请创建.m2目录,然后在.m2目录中复制settings.xml。

mkdir ~/.m2 mkdir〜/ .m2

cp /usr/local/Cellar/maven32/3.1.5/libexec/conf/settings.xml ~/.m2 cp /usr/local/Cellar/maven32/3.1.5/libexec/conf/settings.xml〜/ .m2

You may need to change the maven version in the path 您可能需要在路径中更改Maven版本

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM