O'Reilly logo

Apache Maven Cookbook by Raghuram Bharathan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Manually installing dependencies that are not available in a repository

There may be situations where a library, which is not present in any Maven repository, needs to be used. We have seen one way to use it, that is, specifying it as a dependency with system scope and explicitly specifying the path to it.

The problem with this approach is that this dependency will not be available if you need to distribute your project as a library.

Maven provides a mechanism to install an artifact to your local repository so that you can declare and use it like other dependencies.

How to do it...

Use the following steps to manually install the dependencies that aren't available in a repository:

  1. Add the following dependency to the simple project that we created earlier: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required