当maven中央仓库没有 maven项目又需要管理jar依赖 此时可以自己安装jar包到本地仓库进行管理
这里以小米MIMC的sdk 为例
mvn install:install-file -Dfile=mimc-pcjava-sdk-0.0.4.jar -DgroupId=com.xiaomi.mimc.javasdk -DartifactId=mimc-pcjava-sdk -Dversion=0.0.4 -Dpackaging=jar>
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.4:install-file (default-cli) @ standalone-pom ---
[INFO] Installing D:\ganxiyouth-web\libs\mimc-pcjava-sdk-0.0.4.jar to D:\.m2\repository\com\xiaomi\mimc\javasdk\mimc-pcjava-sdk\0.0.4\mimc-pcjava-sdk-0.0.4.jar
[INFO] Installing C:\Users\xiaoyuzhou\AppData\Local\Temp\mvninstall4238912632320911579.pom to D:\.m2\repository\com\xiaomi\mimc\javasdk\mimc-pcjava-sdk\0.0.4\mimc-pcjava-sdk-0.0.4.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.630 s
[INFO] Finished at: 2018-04-22T23:17:31+08:00
[INFO] Final Memory: 15M/367M
[INFO] ------------------------------------------------------------------------
然后在pom文件中引用即可
<dependency>
<groupId>com.xiaomi.mimc.javasdk</groupId>
<artifactId>mimc-pcjava-sdk</artifactId>
<version>0.0.4</version>
</dependency>