Eclipse uses MAVEN to deliver the management of the jar package to maven.
1. To add a jar, you can directly in the pom.xml in the dependencies Point Add button, in the inside to search for the jar package, if the MAVEN library exists, it is displayed, select can. Screenshots are as follows:
2. If the required jar is not available in the MAVEN library, you need to download it yourself and add the local jar.
There are 2 ways to add a local jar: one: In the MAVEN local repository (a folder that has a jar), place the jar package under the Goupid folder in Pom.xml.
Method Two: Use the MVN install command to match, the command example is as follows:
MVN install:install-file-dfile=d:\maven-jar\hsviewclient-2.0.jar-dgroupid=com.hsview.client-dartifactid= Hsviewclient-dversion=2.0-dpackaging=jar
Description:-dfile is the location of the jar package you downloaded-dgroupid is the corresponding GroupID DartifactId in the POM is also the corresponding dartifactid in the Pom, is also the jar package name (-the part before the symbol),
-dversion is the version of the jar package (-the part behind the symbol)-dpackaging=jar
Method Two is placed in the CMD window to execute the above command.
Successful execution, hint: build success.
If the above command succeeds, you need to match MAVEN's environment variables in advance, not to mention, over.