Spring Cloud 作为独立 Web 运行

问题描述 投票:0回答:1

我正在尝试在本地运行我的 Spring Cloud 函数。

根据此配置,我应该能够在本地作为独立的 Web 应用程序运行我的函数并使用 http 请求调用它们。

我补充一下:

<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-function-web</artifactId> </dependency>
但是,我希望我的 Spring Boot 应用程序继续侦听传入的请求,但它会启动并完成。

我也尝试过额外添加

spring-boot-starter-web

<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-function-web</artifactId> </dependency>
但它一直不监听传入的请求。

我的父母是:

<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>3.2.3</version> <relativePath/> <!-- lookup parent from repository --> </parent>
有什么想法吗?

spring-boot spring-cloud spring-cloud-function
1个回答
0
投票
尝试在 pom.xml 中添加“配置”标签:

<plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <classifier>exec</classifier> </configuration>
    
© www.soinside.com 2019 - 2024. All rights reserved.