Thursday, November 10, 2011

Maven - Installing Dependencies in your Local Computer

This is not something new to me. I just need to document this activity before I forget it again.

There are times when your .jar or api's are not in a central repositories for some reason. This is the time when installing dependencies in your local computer is applicable.

Here are the ways:
1. Install the dependency locally using the install plugin.

maven install:install-file -Dfile=foobar.jar -DartifactId=for-bar -Dversion=1 -Dpackaging=jar
2. Create your own repository and deploy it there. This is a fovrite method for companies with an intranet and need to be able to keep everyone in synch. There is a Maven goal called deploy:deploy-file which is simlar to the install:install-file goal.

On the two ways stated above, I normally used the 1st one if the project is been done by I alone. And if it is a team project, the 2nd ways is what I used.

No comments:

Post a Comment