9

I have a POM file and I'd like to install all plugins/jars that are needed to build the project without building the project so that when I do run "maven package" I won't need an internet connection.
Is there any way to do this?

Tal Zion
  • 1,081
  • 1
  • 11
  • 21
  • possible duplicate of [Using Maven to just download JARs](http://stackoverflow.com/questions/7559500/using-maven-to-just-download-jars) – André Stannek Dec 09 '14 at 13:26
  • possible duplicate of [how to load the dependencies from the pom into classpath of eclipse project?](http://stackoverflow.com/questions/6072583/how-to-load-the-dependencies-from-the-pom-into-classpath-of-eclipse-project) – Joe Dec 09 '14 at 14:00
  • 1
    Possible duplicate of [Maven: Command to update repository after adding dependency to POM](https://stackoverflow.com/questions/8563960/maven-command-to-update-repository-after-adding-dependency-to-pom) – rds Nov 07 '17 at 21:58

1 Answers1

5

You can use the goal: mvn dependency:go-offline

It will download all dependencies and plugins as well.

See http://maven.apache.org/plugins/maven-dependency-plugin/go-offline-mojo.html

wemu
  • 7,236
  • 3
  • 30
  • 51
  • I still get: `Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.6:resources ... Plugin or one of its dependencies could not be resolved ... artifact classworlds:classworlds:jar:1.1-alpha-2 has not been downloaded from it before` – Innokenty Feb 22 '18 at 10:20
  • that jar is in maven central: classworlds:classworlds:1.1-alpha-2 - if maven cant download it it either attempted it before and failed (you could try to just delete your local maven repo and retry) or it cant due to some network or proxy issue – wemu Feb 22 '18 at 20:45