Reputation: 251
Will the .m2
folder be created automatically by Maven, or do you need to create it manually?
What does the .m2/repository
, contain and from where does it come?
Upvotes: 24
Views: 57918
Reputation: 7537
First, it will be created by Maven when you execute a build, such as:
mvn clean install
Note, you could find this out just be executing mvn your self ;)
Second, the contents of .m2 are:
A settings.xml
file that contains global settings for all maven executions.
A folder called repository
that holds all of the local copies of various maven artifacts, either caches of artifacts pulled down from remote repositories, such as Maven Central, or artifacts built by your local maven builds. The artifacts are organized in there in folder structures that mirror the groupId's of the artifacts.
Upvotes: 18
Reputation: 35829
It will be created automatically. The repository folder (also called local repository) will download its content from repositories specified in your user's settings.xml
, the global settings.xml
and possibly in your poms.
Most artifacts will be downloaded from repo1.maven.org
.
Upvotes: 12