Jar包导入本地Maven仓库

导入Maven指令:

mvn install:install-file -Dfile=E:\JAVA\jar\httpmime-4.5.2.jar -DgroupId=org.apache.http.entity.mime -DartifactId=httpmime -Dversion=4.5.2 -Dpackaging=jar

参数如下: 

mvn install:install-file -Dfile=E:\JAVA\jar\httpmime-4.5.2.jar 
                         -DgroupId=org.apache.http.entity.mime 
                         -DartifactId=httpmime 
                         -Dversion=4.5.2 
                         -Dpackaging=jar

参数说明:

(1)-Dfile : 指定jar文件路径与文件名(同目录下只需文件名)

(2)-DgroupId:设置项目代码的包名(一般用组织名)

(3)-DartifactId:设置项目名或模块名

(4)-Dversion :版本号

(5)-Dpackaging : 什么类型的文件(jar包)

 执行结果: 

项目Pom.xml中引入: 

<dependency>
    <groupId>org.apache.http</groupId>
    <artifactId>httpcore</artifactId>
    <version>4.4.4</version>
</dependency>

猜你喜欢

转载自blog.csdn.net/sssxlxwbwz/article/details/125662968