在IntelliJ中启动新项目有一个问题:
succesfully
这是我的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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>JavaTutorial</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>Java Tutorial Course API</name>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.2.RELEASE</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>1.3.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
<version>1.3.2.RELEASE</version>
</dependency>
</dependencies>
<properties>
<maven.compiler.source>7</maven.compiler.source>
<maven.compiler.target>7</maven.compiler.target>
<java.version>1.7</java.version>
</properties>
</project>注意:,我尝试将<dependencyManager>添加到pom.xml中,但是没有任何改变。
主修班:
package springbootstarter;
import org.springframework.boot.SpringApplication;
@SpringBootApplication
public class CourseApiApp {
public static void main(String[] args) {
}
}尝试Reload Maven项目时引发的错误:
org.springframework.boot:spring-boot-starter-web:pom:1.3.2.RELEASE failed to transfer from https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.springframework.boot:spring-boot-starter-web:pom:1.3.2.RELEASE from/to central (https://repo.maven.apache.org/maven2): transfer failed for https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-web/1.3.2.RELEASE/spring-boot-starter-web-1.3.2.RELEASE.pom
org.springframework.boot:spring-boot-autoconfigure:pom:1.3.2.RELEASE failed to transfer from https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.springframework.boot:spring-boot-autoconfigure:pom:1.3.2.RELEASE from/to central (https://repo.maven.apache.org/maven2): transfer failed for https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-autoconfigure/1.3.2.RELEASE/spring-boot-autoconfigure-1.3.2.RELEASE.pom任何帮助都将不胜感激。我一直在寻找解决办法,但没有成功。
发布于 2022-07-20 11:25:28
日志看起来非常干净,项目试图下载依赖项,但是它无法下载。
org.springframework.boot:spring-boot-starter-web:pom:1.3.2.RELEASE failed to transfer from https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.springframework.boot:spring-boot-starter-web:pom:1.3.2.RELEASE from/to central (https://repo.maven.apache.org/maven2): transfer failed for https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-web/1.3.2.RELEASE/spring-boot-starter-web-1.3.2.RELEASE.pom所以,首先检查您与https://repo.maven.apache.org/maven2的连接,然后验证该依赖项和特定版本是否仍然存在,因为它确实很旧。如果是这样,那么尝试强制下载依赖项,如果使用maven,则可以使用:
mvn dependency:resolve注意:要知道,如果您在代理后面,则必须将代理配置为能够被maven/gradle使用
https://stackoverflow.com/questions/73050520
复制相似问题