1. idea添加pom文件后报错Could not transfer artifact org.apache.commons:commons-compress:pom:1.9 from/toxx
背景
idea项目中添加了pom文件,在下载依赖过程中报错
Could not transfer artifact org.apache.commons:commons-compress:pom:1.9 from/to xxxxx,点击文件在浏览器中能下载,但是在idea中却报错了,这个问题纠结我了很久,终于参考如下链接问题解决了
https://blog.csdn.net/u014692224/article/details/112758493
2. 本地有包,但是pom报错
点击update后,点击apply,重启idea即可解决
- maven窗口依赖有波浪线
参照2更新、删除本地包重新clean和package、manven窗口左上角的刷新和线上和线下、删除pom文件中的依赖后close project,然后再打开
3. Failed to read artifact descriptor for org.mybatis:mybatis-spring:jar:2.0.6
删除本地包重新clean和package
4. No plugin found for prefix ‘dependency’ in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local
pom文件中加入
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.0.2</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<!-- configure the plugin here -->
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
5. [ERROR] Plugin org.apache.maven.plugins:maven-dependency-plugin:3.10.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-dependency-plugin:jar:3.10.0: Could not transfer artifact org.apache.maven.plugins:maven-dependency-plugin:pom:3.10.0 from/to xx(https://mirrors.tools.xx.com/maven/): Transfer failed for https://mirrors.tools.xx.com/maven/org/apache/maven/plugins/maven-dependency-plugin/3.10.0/maven-dependency-plugin-3.10.0.pom: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1]
直接浏览这个路径
https://mirrors.tools.xx.com/maven/org/apache/maven/plugins/maven-dependency-plugin/
然后找出存在的版本修改即可,如下是没有3.10这个版本的,把plugin修改为3.5即可