java - 生成的 Spring pom.xml 导致错误“获取 http://maven.apache.org/POM/4.0.0 时出错”
问题描述
(我知道有类似的问题 - 但尝试了解决方案后我仍然卡住了)
我正在尝试使用 Spring 中的 Demo 项目并且无法使生成的 pom.xml 在 IntelliJ 下工作,我尝试了 IntelliJ 建议的解决 URI 未注册的解决方案 - 但这只会导致名义错误。
起初我认为这是一个网络错误,但在浏览器中加载网页时,它是 404s。这让我相信这是我的项目设置在某种程度上存在的问题。
我通过在 IntelliJ 中打开 pom.xml 然后单击“作为项目打开”来导入项目。
我的 pom.xml 如下:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.5.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>prs.ttg.spring</groupId>
<artifactId>test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>test</name>
<description>Test project for Spring Boot</description>
<properties>
<java.version>15</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
没有任何依赖项被加载,我无法终生找到一个可行的解决方案。
我感谢帮助,并理解这是否只是一个愚蠢的问题 - 我是一个愚蠢的人
解决方案
确保在 Preferences | 中启用了Maven捆绑插件。插件。如果您使用代理 - 在 IDE 中设置代理设置:https ://www.jetbrains.com/help/idea/settings-http-proxy.html
如果您通过 File | 启用了 Maven 插件打开项目 新 | Project from Existing Sources 并选择pom.xml文件以从中导入项目。
推荐阅读
- java - 如何在android studio中轻松检查方法是否属于内置类或用户定义类?
- python - 我正在使用 python 异步队列下载网络中的文件,但是当我启动 3 个工作人员来消费队列时,只有一个工作
- php - PHP - 使用 ColorThief 提取图像颜色
- php - 如何创建一个按钮来向 OneSignal 发送通知?
- python - 但是要将字符串值转换为原始字符串作为 selenium chrome 驱动程序的下载路径
- webpack - Webpack babel-loader 是否需要 babel.config.js?
- jquery - 请,谁能告诉我如何清除修剪错误
- java - 嗨,我想通过 spring data JPA 为我的 crudrepository 实现搜索栏操作(按关键字返回所需数据)的 springboot 项目,但是,
- python-3.x - discord webhook 无法发送空消息
- android - Android:使用计时器定期执行任务