运行没问题,打包就报错
Error creating bean with name ‘discoveryLocatorProperties’ defined in class path resource [org/springframework/cloud/gateway/discovery/GatewayDiscoveryClientAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.gateway.discovery.DiscoveryLocatorProperties]: Factory method ‘discoveryLocatorProperties’ threw exception; nested exception is java.lang.NoClassDefFoundError: javax/validation/ValidationException
检查依赖树,添加下面的依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>