maven项目导入本地jar包,然后以pom坐标的方式引入项目。
- 为何有这种奇怪的需求?
maven 上找不到了对应的jar包了,没有对应的坐标。
- 导入方式
将你本地的项目放入maven仓库,使用maven命令。而不是简单的复制进maven仓库。
- 参数说明,-Dfile=你本地jar包的路径,-DgroupId=你取的分组名称,作为仓库项目名的区分,DartifactId=你的分组下的项目名。groupId,artifactId名称怎么取都行,只要你能好区分。你本地jar包的路径要对。
mvn install:install-file -Dfile=D:\smartupload.jar -DgroupId=sm -DartifactId=smartupload -Dversion=1.0 -Dpackaging=jar
<dependency><groupId>sm</groupId><artifactId>smartupload</artifactId><version>1.0</version></dependency>