jagan mohan Mylapuru
jagan mohan Mylapuru

Reputation: 267

spring-cloud-starter-gateway dependency issue

ERROR:


org.springframework.cloud:spring-cloud-starter-gateway:pom:4.0.0 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.cloud:spring-cloud-starter-gateway:pom:4.0.0 from/to central (https://repo.maven.apache.org/maven2): transfer failed for https://repo.maven.apache.org/maven2/org/springframework/cloud/spring-cloud-starter-gateway/4.0.0/spring-cloud-starter-gateway-4.0.0.pom


Below is the pom.xml file

<?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>3.0.0</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>net.javaguides</groupId>
    <artifactId>api-gateway</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>api-gateway</name>
    <description>Demo project for Spring Boot api-gateway</description>
    <properties>
        <java.version>17</java.version>
        <spring-cloud.version>2022.0.0</spring-cloud.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-gateway</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>

Can someone help me to know what is the issue with the spring-cloud-starter-gateway dependency I tried to find the correct compatibility version still no resolution.

Upvotes: 0

Views: 1354

Answers (2)

Omar Mour
Omar Mour

Reputation: 1

i got the same issue, but deleting the maven local repository .m2 didnt sort out my problem, i found the solution on another threads, which you should simply click on The Toggle Offline Mode button In the Maven tool window, This will append the --offline option to all Maven commands that IntelliJ IDEA runs. It will also report any items that cannot be found in the local repository.

offline toggle

[1]: https://i.sstatic.net/VKjbA.png

Upvotes: 0

jagan mohan Mylapuru
jagan mohan Mylapuru

Reputation: 267

Finally, I have found the fix I tried the following Go to the maven local repository .m2 folder and delete the corresponding folder. Restart the IDE, then maven update

Upvotes: 0

Related Questions