Iman
Iman

Reputation: 381

Disable global repository and use just local repository in maven

I am working with maven and there are all of project's dependencies in local repository (means .m2/repository), now, when i want to package project every time, it goes over internet and search over maven repositories to fetch dependencies (somewhere such as http://repo1.maven.org), although, I edit both of /m2/settings.xml and $MAVEN_HOME/conf/settings.xml files, and there isn't any global repository link in those, how can I disable maven to use global repository?

Thank you

Upvotes: 0

Views: 472

Answers (2)

chrome
chrome

Reputation: 659

You can use maven as offline mode.

mvn -o install

Upvotes: 0

chkal
chkal

Reputation: 5668

You could use the -o option:

-o,--offline                           Work offline

In this case Maven won't connect any remote repositories.

Upvotes: 1

Related Questions