D:\litemall>mvn -U clean install
[INFO] Scanning for projects...
[INFO] Artifact org.springframework.boot:spring-boot-starter-parent:pom:2.1.5.RELEASE is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [aliyun (https://maven.aliyun.com/nexus/content/repositories/central, default, releases, blocked)]
[INFO] Artifact org.springframework.boot:spring-boot-starter-parent:pom:2.1.5.RELEASE is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [aliyun (https://maven.aliyun.com/nexus/content/repositories/central, default, releases, blocked)]
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for org.linlinjava:litemall:0.1.0: The following artifacts could not be resolved: org.springframework.boot:spring-boot-starter-parent:pom:2.1.5.RELEASE (present, but unavailable): Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.1.5.RELEASE from/to aliyun (https://maven.aliyun.com/nexus/content/repositories/central): Blocked mirror for repositories: [central (https://repo.maven.apache.org/maven2, default, releases)] and 'parent.relativePath' points at wrong local POM @ line 10, column 13
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.linlinjava:litemall:0.1.0 (D:\litemall\pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for org.linlinjava:litemall:0.1.0: The following artifacts could not be resolved: org.springframework.boot:spring-boot-starter-parent:pom:2.1.5.RELEASE (present, but unavailable): Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.1.5.RELEASE from/to aliyun (https://maven.aliyun.com/nexus/content/repositories/central): Blocked mirror for repositories: [central (https://repo.maven.apache.org/maven2, default, releases)] and 'parent.relativePath' points at wrong local POM @ line 10, column 13 -> [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
(标签-Ar|关键词-for)
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
5条回答 默认 最新
关注 引自免费微信小程序:皆我百晓生
看起来你在尝试通过Maven构建一个基于Spring Boot的应用程序,但是遇到了问题。错误信息表明Spring Boot的 starter parent POM(项目对象模型)版本2.1.5.RELEASE无法从阿里云的Maven仓库下载。
这里有几个可能的解决步骤:
-
检查网络连接:确保你的计算机可以访问互联网,并且没有防火墙或其他安全设置阻止对
https://maven.aliyun.com
的访问。 -
更新Maven本地缓存:有时候,即使远程仓库可用,旧的、不可达的镜像条目可能会导致这个问题。尝试清空本地Maven缓存,然后重新运行
mvn clean install
命令。可以在.m2
目录下找到Maven的本地存储库(默认情况下在用户主目录下),删除repository
文件夹的内容。 -
镜像问题:错误提示说镜像被阻塞了,检查你的Maven配置文件(通常是
~/.m2/settings.xml
)中是否有正确的 mirrors 设置。如果有的话,确认它们指向正确的URL,并且这些URL是可以访问的。 -
确保parent POM引用正确:在你的项目
pom.xml
中,确认Spring Boot的parent POM引用是正确的。这通常在<parent>
元素中指定。例如:<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.1.5.RELEASE</version> </parent>
如果版本号不是最新的,尝试更新到一个可获取的版本。
-
使用不同的Maven仓库:如果阿里云的仓库不可用,你可以选择使用其他官方的或可靠的Maven仓库,比如中央仓库。修改你的
settings.xml
文件中的mirrors部分,或者在命令行中添加-DaltDeploymentRepository=local-repo::default::file:///path/to/local/repo
参数,这样Maven会优先从本地仓库查找依赖。 -
使用最新版的Spring Boot:如果可能,考虑升级到较新的Spring Boot版本,以避免因旧版本不再维护而引起的下载问题。
如果你仍然遇到问题,或者不清楚如何执行上述步骤,请提供更详细的项目结构和
pom.xml
内容,我会更好地协助你解决。本回答被专家选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报 编辑记录-
悬赏问题
- ¥15 为什么eclipse不能再下载了?
- ¥15 编辑cmake lists 明明写了project项目名,但是还是报错怎么回事
- ¥15 关于#计算机视觉#的问题:求一份高质量桥梁多病害数据集
- ¥15 特定网页无法访问,已排除网页问题
- ¥50 如何将脑的图像投影到颅骨上
- ¥15 提问一个关于vscode相关的环境配置问题,就是输入中文但是显示不出来,代码在idea可以显示中文,但在vscode不行,不知道怎么配置环境
- ¥15 netcore使用PuppeteerSharp截图
- ¥20 这张图页头,页脚具体代码该怎么写?
- ¥20 WPF MVVM模式 handycontrol 框架, hc:SearchBar 控件 Text="{Binding NavMenusKeyWords}" 绑定取不到值
- ¥15 需要手写数字信号处理Dsp三个简单题 不用太复杂