Record the problem-when your maven import jar package fails, but you have no errors at all

wrong description

  • Environment: maven3.5.3, idea2019.3
  • Problem details: All jar packages cannot be imported. Check the local warehouse and find that there are no normal jar packages, which are all files ending with .lastUpdate
  • Troubleshooting steps:
    1. Replace the mirror, the result fails
    2. Replace the idea version, the result fails
    3. Replace the computer network, the result fails
    4. Baidu, the results are the same, and the problem cannot be solved at all

problem solved

Under my persistent Baidu, there was still no result. Finally, with the help of one of my older brothers, I found the root of the problem: because Alibaba Cloud no longer supports http downloads, only https (Here is a question. The Alibaba Cloud image of my other computer starts with http, but it still works

The solution steps are as follows

  • Modify the Alibaba Cloud image, modify http to https
        <mirror>
            <id>aliyunmaven</id>
            <mirrorOf>*</mirrorOf>
            <name>阿里云公共仓库</name>
            <url>https://maven.aliyun.com/repository/public</url>
        </mirror>

However, another problem will arise at this time, which is the SSL certificate verification problem. The solution is as follows:

  • In idea, File->Settings, search for importing in the search box, and then copy and add the following code in the VM options for importer on the right
-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true

This configuration is used to ignore the SSL certificate verification, then the problem is solved, the jar package is downloaded normally


Plus, although the previous problem is solved, the current project will report the following error when using the packaging command mvn package

[INFO] Scanning for projects...
Downloading from aliyunmaven: https://maven.aliyun.com/repository/public/org/springframework/boot/spring-boot-starter-parent/2.2.6.RELEASE/spring-boot-starter-parent-2.2.6.RELEASE.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for org.hyx:house:0.0.1-SNAPSHOT: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.2.6.RELEASE from/to aliyunmaven (https://maven.aliyun.com/repository/public): Transfer failed for https://maven
.aliyun.com/repository/public/org/springframework/boot/spring-boot-starter-parent/2.2.6.RELEASE/spring-boot-starter-parent-2.2.6.RELEASE.pom and 'parent.relativePath' points at no local POM @ line 5, column 10
 @
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project org.hyx:house:0.0.1-SNAPSHOT (D:\workspace\house-01\pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for org.hyx:house:0.0.1-SNAPSHOT: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.2.6.RELEASE from/to aliyunmaven (https://maven.aliyun.com/repository/public): Transfer failed for https://m
aven.aliyun.com/repository/public/org/springframework/boot/spring-boot-starter-parent/2.2.6.RELEASE/spring-boot-starter-parent-2.2.6.RELEASE.pom and 'parent.relativePath' points at no local POM @ line 5, column 10: sun.security.validator.ValidatorException: PKIX pa
th building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 2]
[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/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

If the follow-up solution will continue to update, I hope some big guys can give pointers when they see it! ! ! ! !

Guess you like

Origin blog.csdn.net/weixin_45373852/article/details/106185693