Skip to main content

Installing 3rd party jar file to Repository using Maven

   Sometimes the requirement comes when you have to use a third party plugin in your project which is not present in any public repositories. In such a scenario it is advised to deploy this jar file into your repository and then use it as a normal dependency in your Maven project.

This is helpful as the jar file becomes available to a lot of projects in future and if any further development work on the same project is done in future, then the dependency is resolved easily.

It's just a matter of running a maven command and you are ready to go. In case you want to install this plugin into your local repository(.m2 folder) then the command would be different from the normal deployment into your public repository.

For Local Maven Repository(.m2 folder):
mvn install:install-file  -Dfile=<path to the jar file> -DgroupId=<groupId you want to provide>  -DartifactId=<Unique name of the plugin> -Dversion=<version of the plugin you want to deploy> -Dpackaging=jar -DlocalRepositoryPath=<path to your local .m2 folder>

For Public Repository:
mvn deploy:deploy-file -Dfile=<path to the jar file> -DgroupId=<groupId you want to provide>-DartifactId=<Unique name of the plugin> -Dversion=<version of the plugin you want to deploy> -Dpackaging=jar -DrepositoryId=<id of your public repository> -Durl=<URL of the public repository where you want to deploy the jar file>
 That finishes your job. You are ready to go now. Now you can use this as a normal dependency in your project and build your project.

Comments

Popular posts from this blog

IIIT Bangalore interview

You would also like Preparing for Interview , Getting into IIITB ,  Preparing for Online Exam , and FAQ on MS in IIITB We reached the campus for the interview 5 minutes before the scheduled time. I attended a lot of interviews before this but the interview at IIITB seemed special. A little bit of tension and the joy to be in Bangalore balanced my psyche as my brother parked the car in the parking lot. He was my cousin’s friend who was there to accompany me as he himself was a student of IIITB . Nevertheless, both of us went to the help desk located at the main gate where I had to verify myself as me. Then we were handed over a paper which listed all the process that was going to be held and was directed to the main building. Impressive as we already knew what all we had to do without any problem. So we headed towards the main building. It looked great from outside with some perfect combination of colors and a large logo at the top. The campus was tidy enough which seemed ...

IIITB : Preparing for the Online Exam

Now here you are, at the most important part-The Preparation. Well there's nothing to be feared or getting tensed. These exams are all about testing your capabilities. If you are pretty sure about what you can do, then you are there. I will be dividing the article in two parts i.e, Online Exam and Interview (Follow the link provided) and I will be short. Online Exam : The first hurdle, and you need to be fast and smart at the same time. If you have not appeared any competitive exams before then take this as a must suggestion. You ought to be fast and value each second in a minute. The exam will be for some odd 2 hours and you will have 3 sections, viz, APTITUDE, MATHS and PROGRAMMING.           Aptitude:  This section consists of some basic English questions(Articles, Prepositions, Sentence Completion, Antonyms, Synonyms etc), Logical questions and some tricky questions. They are easy but needs some practice. As you have limited time for each section...

Banff & Jasper - 4 days ultimate itinerary (Ideal for non hikers)

Alberta is a paradise on Earth which finds a place in every person's bucket list. This province has something to offer for all kind of people (hikers and non-hikers specifically). Banff, Jasper and Yoho perhaps tops the list of all the places in Alberta and everyone atleast needs to visit these places once in their lifetime. We decided to visit Banff, Jasper and Yoho during the Canada day long weekend in 2019. It was a long weekend and we managed to add one more day to make it a 4 day extended long weekend trip from 29 June to 2 July. I had to do a lot of research as I did not want to miss anything in this trip and make the most out of it. After going through numerous websites and travelogues, I finally was able to create an extensive itinerary for Banff and Jasper. To be honest, you would need around 6 days to complete every places mentioned in this itinerary. But if you are adventurous and can go beyond the line, you can definitely do this in 4 days without missing anything....