Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven - Install project dependencies without building

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?

like image 947
Tal Zion Avatar asked Dec 09 '14 13:12

Tal Zion


People also ask

How do I manually download Maven dependencies?

Summary. You can use the Maven Dependency Plugin to download dependencies. Run mvn dependency:copy-dependencies , to download all your dependencies and save them in the target/dependency folder. You can change the target location by setting the property outputDirectory .

How do I manually add dependencies?

Click the dependency you want to add to your application. You can use Ctrl+click to select multiple non adjacent dependencies, or Shift+click to select multiple adjacent dependencies. Drop the dependencies to the Manual Dependencies folder of the application.

How do I install pom dependencies?

To install the dependencies of maven we need to execute the mvn dependency command which will install all the dependencies. Maven contains a good mechanism for describing dependencies in our project, by using simple elements of XML. The pom. xml file of maven is used to download the dependencies.


1 Answers

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

like image 120
wemu Avatar answered Nov 15 '22 20:11

wemu