Reputation: 429
Is there any way to install an arbitrary Maven artifact into your local repository without first creating and switching to a project and specifying that package as one of its dependencies?
Upvotes: 0
Views: 328
Reputation: 604
Yes, if you have the jar file of the artifact that you want to install to your local repository, you can the run the below command from your command prompt or terminal. Replace the value inside the angle brackets to your desired ones. And then you can use this as a dependency in your Maven projects.
mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id> -DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging>
HTH
Upvotes: 1