.idea pom.xml 中的jar包 install不了本地仓库 解决方案。501 HTTPS Required

本文解决IDEA中pom.xml文件配置的jar包无法通过http安装到本地仓库的问题,原因是官方仓库从http更换为https。解决方案是在maven的setting.xml文件中加入中央仓库的https镜像配置。

idea pom.xml 中的jar包 install不了本地仓库 解决方案

报错:501 HTTPS Required.
Use https://repo.maven.apache.org/maven2/
More information at https://links.sonatype.com/central/501-https-required
原因:官方有原来的http更换成了https
解决方案:在本地maven 的setting.xml文件中镜像处加入:

<mirror>
<id>central</id>
<name>Maven Repository Switchboard</name>
<url>https://repo1.maven.org/maven2/</url>
<mirrorOf>central</mirrorOf>
</mirror>

ok 。解决

Description Resource Path Location Type An error occurred while filtering resources TaskManagerWeb line 1 Maven Java EE Configuration Problem CoreException: Could not get the value for parameter compilerId for plugin execution default-compile: PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.8.1 or one of its dependencies could not be resolved: Failed to collect dependencies at org.apache.maven.plugins:maven-compiler-plugin:jar:3.8.1 -> org.apache.maven:maven-plugin-api:jar:3.0 -> org.sonatype.sisu:sisu-inject-plexus:jar:1.4.2 -> org.codehaus.plexus:plexus-component-annotations:jar:1.7.1: ArtifactDescriptorException: Failed to read artifact descriptor for org.codehaus.plexus:plexus-component-annotations:jar:1.7.1: UnresolvableModelException: Failure to transfer org.sonatype.forge:forge-parent:pom:10 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.sonatype.forge:forge-parent:pom:10 from/to central (https://repo.maven.apache.org/maven2): No connector factories available pom.xml /TaskManagerWeb line 63 Maven Project Build Lifecycle Mapping Problem CoreException: Could not get the value for parameter compilerId for plugin execution default-testCompile: PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.8.1 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.apache.maven:maven-core:jar:3.0, org.apache.maven:maven-settings:jar:3.0, org.apache.maven:maven-settings-builder:jar:3.0, org.apache.maven:maven-repository-metadata:jar:3.0, org.apache.maven:maven-model-builder:jar:3.0, org.apache.maven:maven-aether-provider:jar:3.0, org.sonatype.aether:aether-impl:jar:1.7, org.sonatype.aether:aether-spi:jar:1.7, org.sonatype.aether:aether-api:jar:1.7, org.sonatype.aether:aether-util:jar:1.7, org.codehaus.plexus:plexus-interpolation:jar:1.14, org.codehaus.plexus:plexus-classworlds:jar:2.2.3, org.codehaus.plexus:plexus-component-annotations:jar:1.7.1, org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3, org.sonatype.plexus:plexus-cipher:jar:1.4, org.apache.maven.shared:maven-shared-utils:jar:3.2.1, commons-io:commons-io:jar:2.5, org.apache.maven.shared:maven-shared-incremental:jar:1.1, org.codehaus.plexus:plexus-java:jar:0.9.10, org.codehaus.plexus:plexus-compiler-api:jar:2.8.4, org.codehaus.plexus:plexus-compiler-manager:jar:2.8.4, org.codehaus.plexus:plexus-compiler-javac:jar:2.8.4: Failure to transfer org.apache.maven:maven-core:jar:3.0 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven:maven-core:jar:3.0 from/to central (https://repo.maven.apache.org/maven2): The operation was cancelled. pom.xml /TaskManagerWeb line 63 Maven Project Build Lifecycle Mapping Problem Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (execution: default-compile, phase: compile) pom.xml /TaskManagerWeb line 63 Maven Project Build Lifecycle Mapping Problem Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile (execution: default-testCompile, phase: test-compile) pom.xml /TaskManagerWeb line 63 Maven Project Build Lifecycle Mapping Problem Project configuration is not up-to-date with pom.xml. Select: Maven->Update Project... from the project context menu or use Quick Fix. TaskManagerWeb line 1 Maven Configuration Problem Project configurator "com.genuitec.eclipse.maven.wtp.hibernate.configurator.wtp" required by plugin execution "org.apache.maven.plugins:maven-war-plugin:3.2.3:war (execution: default-war, phase: package)" is not available. To enable full functionality, install the project configurator and run Maven->Update Project Configuration. pom.xml /TaskManagerWeb line 71 Maven Project Build Lifecycle Mapping Problem Project configurator "com.genuitec.eclipse.maven.wtp.spring.configurator.wtp" required by plugin execution "org.apache.maven.plugins:maven-war-plugin:3.2.3:war (execution: default-war, phase: package)" is not available. To enable full functionality, install the project configurator and run Maven->Update Project Configuration. pom.xml /TaskManagerWeb line 71 Maven Project Build Lifecycle Mapping Problem Unhandled exception type SQLException TaskController.java /TaskManagerWeb/src/main/java/com/taskmanager/controller line 57 Java Problem Unhandled exception type SQLException TaskController.java /TaskManagerWeb/src/main/java/com/taskmanager/controller line 69 Java Problem Unhandled exception type SQLException TaskController.java /TaskManagerWeb/src/main/java/com/taskmanager/controller line 80 Java Problem Unhan
05-30
### 关于 `org.jeecg.common.api` 不存在的解决方案Java 开发过程中,遇到类似于“程序 org.jeecg.common.api 不存在”的错误通常是因为项目缺少必要的依赖项或者构建工具未能正确加载这些依赖。以下是针对此问题的具体分析和解决办法: #### 1. **确认 Maven 或 Gradle 配置** 如果使用的是 Maven 构建工具,则需要检查项目的 `pom.xml` 文件中是否含了 Jeecg 的相关依赖。Jeecg 是一个基于 Spring Boot 和 MyBatis 的快速开发平台框架,因此其核心功能依赖可能会被拆分为多个模块。 以下是一个典型的 Jeecg 相关依赖配置示例: ```xml <dependency> <groupId>org.jeecgframework</groupId> <artifactId>jeecg-boot-common</artifactId> <version>3.x.x</version> <!-- 替换为具体版本号 --> </dependency> ``` 确保 `org.jeecg.common.api` 所属的模块已被引入到项目中[^1]。如果没有找到对应的 artifactId,请访问 [Maven Central Repository](https://search.maven.org/) 进行查询并添加正确的依赖。 对于 Gradle 用户,可以在 `build.gradle` 文件中加入类似的声明: ```gradle implementation 'org.jeecgframework:jeecg-boot-common:3.x.x' ``` #### 2. **清理与重新编译项目** 即使已经正确配置了依赖关系,有时由于缓存或其他原因可能导致某些 jar 未成功下载或解析。此时可以执行以下命令强制刷新本地仓库并重建工程结构: ```bash mvn clean install -U ``` 上述指令中的 `-U` 参数用于更新过期的 SNAPSHOT 版本资源文件[^2]。 #### 3. **验证 Classpath 设置** 有时候尽管所有必需库都已存在于 `.m2/repository` 下,但由于 IDE 自身设置不当仍会出现找不到类的情况。建议手动同步 Eclipse/IntelliJ IDEA 等环境下的 Project SDK 及 Libraries 列表,保证它们指向 JDK 正确路径以及完整含第三方 JARs。 另外需要注意的是,在多模块项目里单独测试某一子组件时也要记得将其父级聚合 POM 定义好的 scope 属性传播下去以免遗漏共享部分的功能实现[^3]。 #### 4. **Spring Bean 注册缺失排查** 假如以上操作均无误但仍提示类似 “A component required a bean of type 'xxx' that could not be found.” 错误消息,则可能是自动装配机制失效所致。请参照官方文档调整 Application Context 初始化逻辑或将目标 Mapper 映射器显式注册成容器管理实例[^4]: ```java @Configuration public class AppConfig { @Bean public SysDictCoreMapper sysDictCoreMapper() { return new SysDictCoreMapperImpl(); } } ``` --- ### 总结 综上所述,“org.jeecg.common.api 不 存 在 ” 主要源于外部 Jar 缺失或是内部上下文绑定失败两方面因素引起 。通过合理增补所需构件至 Build Script 并妥善维护 Runtime Environment 即可有效规避此类状况发生。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值