我正在使用 Spring 版本 - 2.4.5
\n应用程序属性:
\nspring.application.name = api-gateway\nserver.port = 8765\n#Had to put the below as I was facing No spring.config.import pro#perty has been defined and this has been put in currency exchang#e, currency converter and naming server as well\nspring.cloud.config.enabled=false \n\neureka.client.service-url.defaultZone = http://localhost:8761/eureka\n\nspring.cloud.gateway.discovery.locator.enabled=true\n\n#Tried the below two, but couldnt resolve the issue\neureka.instance.hostname=localhost\nspring.cloud.gateway.discovery.locator.lower-case-service-id=true\nRun Code Online (Sandbox Code Playgroud)\n所有依赖项均已正确导入。
\nPOM文件
\n<?xml version="1.0" encoding="UTF-8"?>\n<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\n xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">\n <modelVersion>4.0.0</modelVersion>\n <parent>\n <groupId>org.springframework.boot</groupId>\n <artifactId>spring-boot-starter-parent</artifactId>\n <version>2.4.5</version>\n <relativePath/> <!-- lookup parent from repository -->\n </parent>\n <groupId>com.in28minutes.microservices</groupId>\n <artifactId>api-gateway</artifactId>\n …Run Code Online (Sandbox Code Playgroud)