Maven: install an external jar into local Maven repository, add the jar package to the maven Library

Source: Internet
Author: User

Install an external jar into local Maven Repository

Adding a jar package to the maven library solves the problem of how to add dependency.

The original Article is in English. I don't know why, so I can't open it, so I have to use a Google snapshot to open it.

 

Sometimes, you project will have dependency on a jar which is not in officialMaven Repository, And maybe it is propriety JAR file which will never be partMaven Repository. In this case, you have to put it to your localRepositoryYour self to solve the dependency.

There is a install plug in to do this job, which is something like:

MVN install: install-file-dgroupid = <your_group_name> \-dartifactid = <your_artifact_name> \-dversion = <snapshot> \-dfile = <strong> \-dpackaging = jar \-dgeneratepom = true

For example, you want to install the danga's memcached client plugin, You can do:

 
MVN install: Install-file-dgroupid = com. danga \-dartifactid = memcached \-dversion = 2.0.1 \-dfile = java_memcached-release_2.0.1.jar \-dpackaging = jar \-dgeneratepom = true

This will add the memcache jar into your local maven2RepositoryUnder groupid com. danga and artifactid memcached, you can then edit your pom. xml adding this dependency.

However,MavenEclipse can not recognize it since it always search from publicRepository.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.