解决Maven中关于依赖导入不进的问题
作者:有个机车梦 时间:2023-09-05 23:13:08
我们通过项目的reimport等众多办法无法解决之后:
假设这个是爆红的,因为被我已经解决了。
我们进入到我们的本地仓库, 新建包。
在repository中我们新建一个com\github\tobato\fastdfs-client\1.26.7
先是groupid -> artifactId -> version (-SNAPASHOT省略)
建立好文件夹之后,我们自己手动导入该jar包。
先检查自己的电脑是否配置了MAVEN
关于MAVEN3.6的配置 请查看
检查MVN的版本 确认是否安装
我们jar包放在了D:\Environment\apache-maven-3\repository\com\github\tobato\1.26.7\fastdfs-client-1.26.7-SNAPSHOT.jar
控制太输入这个:
mvn install:install-file -Dfile=D:\Environment\apache-maven-3\repository\com\github\tobato\1.26.7\fastdfs-client-1.26.7-SNAPSHOT.jar -DgroupId=com.github.tobato -DartifactId=fastdfs-client -Dversion=1.26.7-SNAPSHOT -Dpackaging=jar
-Dfile=你手动下载jar包的全路径
-DgroupId=该jar包的groupId
-DartifactId=该jar包的artifactId
-Dversion=该jar包的version
-Dpackaging=该文件为jar包。
最后成功!!!!
补充知识:maven工程的pom.xml中添加程序依赖包依然无法导入包的解决办法
问题如下所示:
解决办法:
首先查看导入的包是否正确;
导入包正确之后,查看是否保存,若已经保存,则进行强制刷新。
刷新步骤:右击项目——>maven——>update project——>force update。
进入Update Project
选择错误的工程并在force update of snapshots前面打钩,之后OK即可。
解决之后如下,错误就没有了。
来源:https://blog.csdn.net/Yuz_99/article/details/99167350
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Spring boot+mybatis+thymeleaf 实现登录注册增删改查功能的示例代码
![](https://img.aspxhome.com/file/2023/3/122303_0s.png)
android开机自启动APP及使用adb命令测试方法
android开发教程之自定义控件checkbox的样式示例
ASM的tree api对匿名线程的hook操作详解
![](https://img.aspxhome.com/file/2023/9/139399_0s.png)
详解C#用new和override来实现抽象类的重写区别
![](https://img.aspxhome.com/file/2023/1/116641_0s.png)
Android 自定义gradle property详解及实例代码
Ubuntu 安装 JDK8 的两种方法(总结)
Java中工具Jstack的使用实例
Spring AOP实现接口请求记录到数据库的示例代码
![](https://img.aspxhome.com/file/2023/4/58064_0s.png)
详解Java如何改变字符串中的字符
![](https://img.aspxhome.com/file/2023/2/121952_0s.png)
WPF中ImageBrush常用方式介绍
![](https://img.aspxhome.com/file/2023/1/76401_0s.png)
intellij idea创建第一个动态web项目的步骤方法
![](https://img.aspxhome.com/file/2023/7/110607_0s.png)
SpringBoot yml配置文件读取方法详解
![](https://img.aspxhome.com/file/2023/6/99916_0s.png)
Java使用JSON传递字符串注意事项解析
![](https://img.aspxhome.com/file/2023/7/84277_0s.png)
java 实现将Object类型转换为int类型
![](https://img.aspxhome.com/file/2023/5/58825_0s.png)
Flutter 图片开发核心技能快速掌握教程
![](https://img.aspxhome.com/file/2023/4/108294_0s.png)
java创建以任意图片为背景的窗口
![](https://img.aspxhome.com/file/2023/5/110885_0s.jpg)
Java 中 hashCode() 与 equals() 的关系(面试)
Springboot2.x+ShardingSphere实现分库分表的示例代码
![](https://img.aspxhome.com/file/2023/1/59591_0s.jpg)