On a Windows machine, the .m2 folder is expected to be located under ${user.home}
. On Windows 7 and Vista this resolves to <root>Users<username>
and on XP it is <root>Documents and Settings<username>.m2
. So you'd normally see it under c:UsersJonathan.m2
.
If you want to create a folder with a .
prefix on Windows, you can simply do this on the command line.
- Go to Start->Run
- Type cmd and press Enter
- At the command prompt type md c:UsersJonathan.m2 (or equivalent for your ${user.home} value).
Note that you don't actually need the .m2 location unless you want to create a distinct user settings file, which is optional (see the Settings reference for more details).
If you don't need a separate user settings file and don't really want the local repository under your user home you can simply set the location of your repository to a different folder by modifying the global settings file (located in confsettings.xml).
The following snippet would set the local repository to c:Maven
epository
for example:
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>c:Maven
epository</localRepository>
...
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…