Reputation:
i am new to java and have mainly used node.js for most of my projects. I have used npm and used the npm install function to download packages. In maven, is there a similar function that easily installs packages?
Upvotes: 9
Views: 3438
Reputation: 3097
There's also mvn dependency:go-offline
to download the dependencies and prepare to run the rest of the tasks without any connection to the internet.
I was looking for a way to install maven dependencies during a CI job, while explicitly NOT compiling the code or running the tests.
Upvotes: 4
Reputation: 693
Keep all the dependencies in your pom.xml
(You can think of this as package.json
). If you are using an IDE like eclipse it will automatically download the dependencies for you. If you want to download the dependencies from the command line run mvn install
.
You can find the corresponding XML for dependencies here https://mvnrepository.com/
Upvotes: 0
Reputation: 351
Maven doesn't have an install command. Before any task you run maven checks if the project was changed and downloads any new dependency you specified from Maven Central repository.
EDIT: Maven calls the resolver for most tasks you run.
Upvotes: -3