maven,本地jar包,打包报错
情况:
部署一个springboot+vue的项目(若依)
项目中用到了一个 "本地的第三方jar包" //为什么使用本地jar,因为我们使用的阿里云的maven没有这个jar包,只能使用本地自己的
问题来了,打包时候报错:
而且他用的是:本地路径导入:本地jar //(这个不影响本地运行,但是影响打包,打包不认识,你本地的jar包呀)
我想的方法:把本地的jar包放到maven里面(手动导入maven) //确实这个方法可行
//下面看我的实现
[INFO]
[INFO] ---------------------< com.archive:archive-admin >----------------------
[INFO] Building archive-admin 3.8.7
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] The POM for com.archive:archive-framework:jar:3.8.7 is missing, no dependency information available
[WARNING] The artifact mysql:mysql-connector-java:jar:8.0.33 has been relocated to com.mysql:mysql-connector-j:jar:8.0.33
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.000 s
[INFO] Finished at: 2024-07-08T17:50:49+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project archive-admin: Could not resolve dependencies for project com.archive:archive-admin:jar:3.8.7: Failure to find com.archive:archive-framework:jar:3.8.7 in https://maven.aliyun.com/repository/public was cached in the local repository, resolution will not be reattempted until the update interval of aliyunmaven has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
--------
Failure to find com.aspose:aspose-words-jdk16:jar:15.8.0 in https://maven.aliyun.com/repository/public was cached in the local repository, resolution will not be reattempted until the update interval of aliyunmaven has elapsed or updates are forced
1、手动导入 "本地jar包" 到 "maven"中
// todo:
//C:\Users\student\Desktop\archive\archive-master\aspose-words-15.8.0\aspose-words-15.8.0.jar
//这个磁盘路径换成自己本地jar包的路径
mvn install:install-file -Dfile=C:\Users\student\Desktop\archive\archive-master\aspose-words-15.8.0\aspose-words-15.8.0.jar -DgroupId=com.aspose -DartifactId=sapose-words-jdk16 -Dversion=15.8.0 -Dpackaging=jar
出现:SUCCESS,这个xxx.jar 变下载到 你自己maven的 com.xxx.xxx路径下 (表示成功了)
//刷新maven:
mvn clean -U -X // (注意,要在你springboot的pom文件执行,不然会显示找不到pom文件)
点击进去,可以看见(一下两个图片)
1-出现图片1,表示成功导入maven里面了
2-查看pom文件,把内容复制了springboot项目里面,就可以使用改依赖了
上面是本地文件形式导入使用,下面是maven使用
这样就可以正常运行和使用了
标签:INFO,springboot,jar,maven,报错,本地,com,archive
From: https://www.cnblogs.com/chen-zhou1027/p/18290672