java开发工具IntelliJ或eclipse中maven项目pom文件错误failed to read artifact descriptor for xx.jar问题解决办法

下载安装好开发软件之后,IntelliJ会自动对maven插件进行配置,file-setting 输入maven可查看到配置信息:




pom文件的编写过程会出现project错误,


第一种想法:在第一张图中home directory 和 setting file

第二种方法:

新建一个dependency的时候MAVEN会自动获取相关的jar,如果没有就会自己去下载。首先我看了一下External Libraries里面并没有mybatis,然后通过菜单File-Project Structure打开查看libraries发现mybatis的jar被划上了红线,说明mybatis的路径下存在问题,打开路径一看,jar包根本没有下载下来。

大多是由于依赖包没有被正确地下载和安装到指定的路径,dependency中相关的参数和标签有没有写错,看一下那个目录下有没有jar文件

解决:

1. 删除Project Structure-Libraries中划了红线的那个jar,同时删除对应目录下的文件和文件夹,这里我删除了原来的MyBatis目录。

2. 打开IntelliJ 右边的Maven Project,点击左上角那个刷新的按钮(Reimport All Maven Projects),注意请保证处于联网状态,这时候Maven会自动下载相关的依赖包。


3.等待下载完毕,OK解决。


这样的问题大多是由于依赖包没有被正确地下载和安装到指定的路径,仔细回想自己之前在pom内的dependency中相关的参数和标签有没有写错,去看一下那个目录下有没有jar文件。


推荐:https://blog.csdn.net/ainuser/article/details/71196256

"C:\Program Files\Java\jdk-1.8\bin\java.exe" -Dmaven.multiModuleProjectDirectory=F:\workmode\h5xjxj\ech-log-server\ech-log-api -Djansi.passthrough=true -Dmaven.home=F:\dev_software\apache-maven-3.6.3 -Dclassworlds.conf=F:\dev_software\apache-maven-3.6.3\bin\m2.conf "-Dmaven.ext.class.path=F:\idea2023\IntelliJ IDEA 2023.1.2\plugins\maven\lib\maven-event-listener.jar" "-javaagent:F:\idea2023\IntelliJ IDEA 2023.1.2\lib\idea_rt.jar=53993:F:\idea2023\IntelliJ IDEA 2023.1.2\bin" -Dfile.encoding=UTF-8 -classpath F:\dev_software\apache-maven-3.6.3\boot\plexus-classworlds-2.6.0.jar;F:\dev_software\apache-maven-3.6.3\boot\plexus-classworlds.license org.codehaus.classworlds.Launcher -Didea.version=2023.1.2 -s C:\Users\田文成\.m2\settings_XJ_git.xml -Dmaven.repo.local=F:\dev_software\repository\localRepository\localRepository install [INFO] Scanning for projects... [INFO] [INFO] -----------------------< com.ai.ecs:ech-log-api >----------------------- [INFO] Building ech-log-api 0.0.1-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- Downloading from nexus1: http://mgr.devstone.cn:18080/nexus/content/groups/public/org/apache/maven/plugins/maven-compiler-plugin/2.5.1/maven-compiler-plugin-2.5.1.pom [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 22.280 s [INFO] Finished at: 2023-07-12T16:30:43+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Plugin org.apache.maven.plugins:maven-compiler-plugin:2.5.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-compiler-plugin:jar:2.5.1: Could not transfer artifact org.apache.maven.plugins:maven-compiler-plugin:pom:2.5.1 from/to nexus1 (http://mgr.devstone.cn:18080/nexus/content/groups/public): Transfer failed for http://mgr.devstone.cn:18080/nexus/content/groups/public/org/apache/maven/plugins/maven-compiler-plugin/2.5.1/maven-compiler-plugin-2.5.1.pom: Connect to mgr.devstone.cn:18080 [mgr.devstone.cn/218.94.91.233] failed: Connection timed out: connect -> [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/PluginResolutionException 刚导入项目依赖报错
07-13
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值