Idea中 maven 下载jar出现证书问题

目录

1: 具体错误:

2: 忽略证书代码: 

3: 关闭所有idea, 清除缓存, 在下面添加如上忽略证书代码

4:执行 maven clean 然后刷刷新依赖

完成,撒花!!!!!!


1: 具体错误:

Could not transfer artifact org.springframework.boot:spring-boot-dependencies:pom:2.3.7.RELEASE from/to aliyunmaven (https://maven.aliyun.com/repository/public): transfer failed for https://maven.aliyun.com/repository/public/org/springframework/boot/spring-boot-dependencies/2.3.7.RELEASE/spring-boot-dependencies-2.3.7.RELEASE.pom
"C:\Program Files\Java\jdk1.8.0_202\bin\java.exe" -Dmaven.multiModuleProjectDirectory=D:\LTNEW\unicom-alarm -Djansi.passthrough=true -Dmaven.home=D:\apache-maven-3.8.2 -Dclassworlds.conf=D:\apache-maven-3.8.2\bin\m2.conf "-Dmaven.ext.class.path=D:\Program Files\JetBrains\IntelliJ IDEA 2024.1\plugins\maven\lib\maven-event-listener.jar" "-javaagent:D:\Program Files\JetBrains\IntelliJ IDEA 2024.1\lib\idea_rt.jar=64042:D:\Program Files\JetBrains\IntelliJ IDEA 2024.1\bin" -Dfile.encoding=UTF-8 -classpath D:\apache-maven-3.8.2\boot\plexus-classworlds-2.6.0.jar;D:\apache-maven-3.8.2\boot\plexus-classworlds.license org.codehaus.classworlds.Launcher -Didea.version=2024.1 -s D:\apache-maven-3.8.2\conf\settings.xml -Dmaven.repo.local=D:\apache-maven-3.8.2\Jar -DskipTests=true clean
[INFO] Scanning for projects...
Downloading from aliyunmaven: https://maven.aliyun.com/repository/public/org/springframework/boot/spring-boot-dependencies/2.3.7.RELEASE/spring-boot-dependencies-2.3.7.RELEASE.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Non-resolvable import POM: Could not transfer artifact org.springframework.boot:spring-boot-dependencies:pom:2.3.7.RELEASE from/to aliyunmaven (https://maven.aliyun.com/repository/public): transfer failed for https://maven.aliyun.com/repository/public/org/springframework/boot/spring-boot-dependencies/2.3.7.RELEASE/spring-boot-dependencies-2.3.7.RELEASE.pom @ line 208, column 25
[ERROR] 'dependencies.dependency.version' for org.springframework.boot:spring-boot-starter-web:jar is missing. @ line 65, column 21
[WARNING] 'dependencies.dependency.scope' for org.springframework.boot:spring-boot-dependencies:pom must be one of [provided, compile, runtime, test, system] but is 'import'. @ line 76, column 20
[ERROR] 'dependencies.dependency.version' for mysql:mysql-connector-java:jar is missing. @ line 86, column 21
[ERROR] 'dependencies.dependency.version' for org.projectlombok:lombok:jar is missing. @ line 110, column 21
[ERROR] 'dependencies.dependency.version' for org.springframework.boot:spring-boot-starter-test:jar is missing. @ line 115, column 21
[ERROR] 'dependencies.dependency.version' for org.springframework.boot:spring-boot-starter-data-redis:jar is missing. @ line 153, column 21
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project com.chinaunicom.sh:unicom-alarm:0.0.1-SNAPSHOT (D:\LTNEW\unicom-alarm\pom.xml) has 6 errors
[ERROR]     Non-resolvable import POM: Could not transfer artifact org.springframework.boot:spring-boot-dependencies:pom:2.3.7.RELEASE from/to aliyunmaven (https://maven.aliyun.com/repository/public): transfer failed for https://maven.aliyun.com/repository/public/org/springframework/boot/spring-boot-dependencies/2.3.7.RELEASE/spring-boot-dependencies-2.3.7.RELEASE.pom @ line 208, column 25: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 2]
[ERROR]     'dependencies.dependency.version' for org.springframework.boot:spring-boot-starter-web:jar is missing. @ line 65, column 21
[ERROR]     'dependencies.dependency.version' for mysql:mysql-connector-java:jar is missing. @ line 86, column 21
[ERROR]     'dependencies.dependency.version' for org.projectlombok:lombok:jar is missing. @ line 110, column 21
[ERROR]     'dependencies.dependency.version' for org.springframework.boot:spring-boot-starter-test:jar is missing. @ line 115, column 21
[ERROR]     'dependencies.dependency.version' for org.springframework.boot:spring-boot-starter-data-redis:jar is missing. @ line 153, column 21
[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

进程已结束,退出代码为 1

2: 忽略证书代码: 

-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true

3: 关闭所有idea, 清除缓存, 在下面添加如上忽略证书代码

4:执行 maven clean 然后刷刷新依赖

完成,撒花!!!!!!

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
### 回答1: 在IDEA使用Maven下载jar包的步骤如下: 1. 打开IDEA,选择需要添加jar包的项目,右键点击pom.xml文件,选择“Add as Maven Project”将项目转换为Maven项目。 2. 在pom.xml文件添加需要下载jar包的依赖信息,例如: ``` <dependencies> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>3.9</version> </dependency> </dependencies> ``` 其,groupId表示依赖的组织ID,artifactId表示依赖的项目ID,version表示依赖的版本号。 3. 点击IDEA界面右侧的Maven Projects,展开项目的依赖树,找到需要下载jar包,右键点击选择“Download Sources”或“Download Javadoc”即可下载对应的源码或文档。 4. 如果需要下载所有依赖的jar包,可以在Maven Projects选择项目根节点,右键点击选择“Reimport”,等待Maven自动下载所有依赖的jar包即可。 注意:在下载jar包之前,需要保证本地已经正确配置了Maven的镜像和仓库地址。可以在IDEA打开Settings,找到Maven选项卡,配置对应的镜像和仓库地址。 ### 回答2: 在IDEA使用maven下载jar包是一件非常简单的事情,可以通过以下步骤来实现: 1. 打开IDEA,进入需要下载jar包的maven项目,可以在项目的根目录下找到pom.xml文件。 2. 打开pom.xml文件,在其添加需要下载jar包依赖,例如: ``` <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version>4.5.13</version> </dependency> ``` 其,groupId是项目组标识符,artifactId是包名,version是版本号。 3. 点击IDEA的右侧“Maven Projects”栏,可以看到刚才添加的依赖被列在了“Dependencies”下方(如果看不到,则需要点击“Reload All Maven Projects”按钮进行刷新)。 4. 右键点击需要下载jar包依赖,选择“Download Sources and Documentation”或“Download Jar”选项(根据需要选择),即可开始下载对应的jar包。 5. 下载完成后,可以在项目根目录下的.m2文件夹找到对应的jar包文件,也可以在IDEA的工具栏点击“Project Structure”来查看已经引入的jar包列表。 以上就是在IDEA使用maven下载jar包的方法,简单易行、快速便捷,能够满足大多数项目的依赖管理需求。 ### 回答3: Maven是一个自动化的构建工具,在Java开发广泛应用。Maven可以自动下载依赖的jar包,并且能够很方便地管理项目的依赖关系。在IDEA使用Maven下载jar包也是非常简单的。 首先,在IDEA打开Maven项目的pom.xml文件,可以看到依赖管理的部分。在该部分添加需要下载jar包的依赖信息,例如: ``` <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-io</artifactId> <version>1.3.2</version> </dependency> ``` 其,groupId为组织ID,artifactId为项目ID,version为版本号。这些信息可以在Maven官方网站(https://mvnrepository.com/)上查找。 添加完依赖信息后,在IDEAMaven工具窗口,点击“Reimport”按钮,或者在命令行输入“mvn clean install”,Maven会自动从央仓库(https://mvnrepository.com)下载所需的jar包。 如果要指定下载某个版本的jar包,可以在命令行使用以下命令: ``` mvn dependency:get -Dartifact=groupId:artifactId:version ``` 例如,下载commons-io-1.3.2.jar: ``` mvn dependency:get -Dartifact=org.apache.commons:commons-io:1.3.2 ``` 使用Maven下载jar包十分方便,能够有效地管理项目的依赖,让开发更加高效。在IDEA使用Maven下载jar包也是非常简单易用的。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

wcybaonier

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值