1. Download maven
Address: http://maven.apache.org/download.cgi
2. Install Maven
System variable: maven_home = D:\maven\apache-maven-3.3.9
System variable: PATH =%maven_home%\bin
I believe that we all have to match the environment variables, the detailed steps will not say, to the attribute name and attribute values to match the OK.
Open cmd, knock inside: mvn-version
3.Eclipse settings
4. Importing a local jar
For example:
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20090211</version>
</dependency>
Add this file to the Pom.xml file and the tool will automatically download the jar package.
If you add a method for a jar package that does not exist in the online MAVEN resource.
Need to use to command:
MVN install:install-file-dfile=%_jar%-dgroupid=%_gid%-dartifactid=%_aid%-dversion=%_ver%-Dpackaging=%_pkg%
%_jar%: Enter the file location of the jar (the address of the local file)
%_gid%: Input groupid (usually the name of the jar package)
%_aid%: Input Artifactid (similar to above, finer in scope)
%_ver%: Enter version (release number)
%_pkg%: Input Packaging Method (default is Jar)
Example:
MVN install:install-file-dfile=d:\jar\vspherelib.jar-dgroupid=com.cpc-dartifactid=vsphere-dversion=1.0- Dpackaging=jar
Then the package succeeds.
The jar package is then imported into Maven dependencies, but the jar is still local.
Install MAVEN, Eclipse settings, add address jar