例如:
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.core</artifactId>
<version>4.4.3</version>
</dependency>
1、前提:配置本地maven环境
2、cmd 执行命令(以上例子添加):
mvn install:install-file -DgroupId=org.wso2.carbon -DartifactId=org.wso2.carbon.core -Dversion=4.4.3 -Dpackaging=jar -Dfile=d:\org.wso2.carbon.core-4.4.30.jar
解释:-DgroupId => <groupId>
-DartifactId=> <atrifactId>
-Dversion => <version>
-Dpackaging => 类型为jar包
-Dfile => 你本地jar包位置
成功结果:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.4:install-file (default-cli) @ standalone-pom
---
[INFO] Installing d:\org.wso2.carbon.logging-4.4.30.jar to D:\software\maven\mvn
Repository\org\wso2\carbon\org.wso2.carbon.core\4.4.3\org.wso2.carbon.core
-4.4.3.jar
[INFO] Installing C:\Users\BONC\AppData\Local\Temp\mvninstall7647462642113691050
.pom to D:\software\maven\mvnRepository\org\wso2\carbon\org.wso2.carbon.core\
4.4.3\org.wso2.carbon.core-4.4.3.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.375 s
[INFO] Finished at: 2018-07-19T10:53:25+08:00
[INFO] ------------------------------------------------------------------------