Is there a maven command line option for offline mode?

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

I would suggest something like, for example.

mvn install -Dmaven.offline.true 
+51
java maven
Jan 13 '12 at 13:38
source share
4 answers

Specify offline mode through -o / --offline :

 mvn -o install 

Link to Maven Book

+115
Jan 13 '12 at 13:40
source share

Simply:

 mvn --offline 

In the future, I recommend contacting mvn --help .

+15
Jan 13 2018-12-12T00:
source share

Maven battery life is invoked using mvn -o .

However, this may not be enough, because sometimes the current project refers to artifacts that are not yet present in the Maven local storage cache ( ~/.m2/repository ). An attempt to create this project offline will fail because the required dependencies are missing and cannot be downloaded.

So there is another useful goal:

 mvn dependency:go-offline 

This is a great team to launch before jumping on a plane, which will improve your chances of BUILD SUCCESS . See offline documentation for more information .

+11
Jan 14 '15 at 19:08
source share

Try -o or even --help to get help with all options

+3
Jan 13 2018-12-12T00:
source share



All Articles