【Maven】maven向本地仓库导入jar包(处理官网没有的jar包)

来源:互联网 发布:sql中不包含某字符串 编辑:程序博客网 时间:2024/04/29 18:35

在中央仓库找不到项目依赖的jar包,因此利用idea进行了本地引入jar包,但是在maven compile时出错了,因为maven是根据pom进行构建的,找不到本地引入的包,所以暂时想到的解决办法就是讲本地的jar包安装到本地仓库当中去。

运行命令

mvn install:install-file -Dfile=C:\Users\server\Desktop\JsonTIN\JsonTIN\lib\gt-shapefile-15.1.jar -DgroupId=modelingtool-gt-shapefile    -DartifactId=modelingtool-gt-shapefile -Dversion=1.0 -Dpackaging=jar  -DgeneratePom=true -DcreateChecksum=true

安装dll的话:

mvn install:install-file -Dfile=ogrjni.dll -DgroupId=whu.lmars.modelingtool.dll -DartifactId=modeling-ogrjni  -Dversion=1.0 -Dpackaging=dll -DgeneratePom=true

但是在pom中引入dll之后,发现并不能找到dll,因为安装到仓库中的dll修改了名字,dll名字不能随意修改。

然后pom包这样写:

<dependency>    <groupId>modelingtool-gt-metadata</groupId>    <artifactId>modelingtool-gt-metadata</artifactId>    <version>1.0</version></dependency>
0 0
原创粉丝点击