[Switch] maven imports jar packages that are not in the official warehouse into the local warehouse

An overview
    Using the Paoding tokenizer, it is found that the jar package of paoding-analysis is not in the central warehouse, and if it is simply copied from the jar package obtained from other places to the local warehouse, the pom file still reports an error and cannot be imported. in the classpath of the project. You need to use maven to import the jar package into the local warehouse, you cannot copy it manually. The following will introduce how to import jar packages that are not in the central repository to the local repository.

Two environment
windows 7
Apache Maven 3.1.1

Three steps
1. The command format is as follows
[plain] view plain copy View the code slice on CODE Derived to my code slice
<span style="font-family:SimSun;font-size:18px ;">mvn install:install-file  
-DgroupId=package name   
-DartifactId=project name-   
Dversion=version number-   
Dpackaging=jar   
-Dfile=path where the jar file is located</span> 

2. Execute the installation
mvn install:install-file -Dfile=E:\JavaEE\development library\paoding-analysis.jar -DgroupId=net.paoding -DartifactId=paoding-analysis -Dversion=2.0.4-beta -Dpackaging=jar -DgeneratePom=true -DcreateChecksum=true

3.pom dependency settings
[html] view plain copy View code slice on CODE derived to my code slice
<span style="font-family:SimSun;font-size:18px;"><dependency> 
    < groupId>net.paoding</groupId> 
    <artifactId>paoding-analysis</artifactId> 
    <version>2.0.4-beta</version> 
    <scope>runtime</scope> 
</dependency></span> 

Original address: http://yeelor.iteye.com/blog/1646928Top 2
_

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326273418&siteId=291194637