Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a maven command line option for offline mode?

Tags:

java

maven

You can specify in your maven settings file that you want to run in offline mode, but is there an equivalent command line option?

I would imagine something like e.g.

mvn install -Dmaven.offline.true 
like image 736
Joel Avatar asked Jan 13 '12 13:01

Joel


People also ask

Can maven be used offline?

You can run maven in offline mode mvn -o install . Of course any artifacts not available in your local repository will fail. Maven is not predicated on distributed repositories, but they certainly make things more seamless.

What is mvn dependency offline?

In order to prepare for offline mode, we can use the go-offline goal from the maven-dependency-plugin: mvn dependency:go-offline. This goal resolves all project dependencies — including plugins and reports and their dependencies. After running this goal, we can safely work in offline mode.


2 Answers

Specify offline mode via -o/--offline:

mvn -o install 

Maven book reference

like image 127
Dave Newton Avatar answered Sep 19 '22 00:09

Dave Newton


Just a simple:

mvn --offline 

In the future, I recommend referring to mvn --help.

like image 45
khmarbaise Avatar answered Sep 18 '22 00:09

khmarbaise