maven 手动安装本地jar包

mvn install:install-file  
-DgroupId=包名  
-DartifactId=项目名  
-Dversion=版本号  
-Dpackaging=jar  
-Dfile=jar文件所在路径  

1,本地D盘中有个jar,例如:D:\QRCode.jar  

2,cmd 中执行mvn install 命令  
格式为:  
mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id>-DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging>  
例如:  
mvn install:install-file -Dfile=D:\QRCode.jar -DgroupId=QRCode -DartifactId=QRCode -Dversion=3.0 -Dpackaging=jar  

3,在pom.xml中增加如下语句  
    <dependency>
        <groupId>QRCode</groupId>
        <artifactId>QRCode</artifactId>
        <version>3.0</version>
    </dependency>  

这里写图片描述
转载地址 https://blog.csdn.net/he90227/article/details/39078803

猜你喜欢

转载自blog.csdn.net/weixin_36910300/article/details/80197615