AFAIK maven does not have an installer for Windows, you simply unzip it wherever you like, as explained here.
However in many places there are references to a .m2
folder under the user folder (in Win7 I would guess it to be by default at C:\Users\.m2
. Alas I do not have that folder. Is there some command to create this folder? Am I missing something basic?
1) Maven Local Repository It is created by the maven when you run any maven command. By default, maven local repository is %USER_HOME%/. m2 directory.
By default, Maven local repository is defaulted to ${user. home}/. m2/repository folder : Unix/Mac OS X – ~/.
m2 folder will not be present in C:\Users\ {user} path. To generate the folder you have to run any maven command e.g. mvn clean, mvn install etc. so that it searches for settings. xml in .
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:\Users\Jonathan\.m2
.
If you want to create a folder with a .
prefix on Windows, you can simply do this on the command line.
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 \conf\settings.xml).
The following snippet would set the local repository to c:\Maven\repository
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\repository</localRepository> ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With