RandomDSdevel
RandomDSdevel

Reputation: 429

Installing Maven Artifacts Into a Local Repository From Outside Of Any Project

     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

Answers (1)

ranjithkr
ranjithkr

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

Related Questions