spring-boot-starter-parent использует 1.5.9
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.9.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
Зависимость:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-zuul</artifactId>
<version>2.0.0.RELEASE</version>
</dependency>
Приложение:
@RestController
@ComponentScan({"com.bmc.common.portal","com.bmc.common.portal.controllers","com.bmc.dem", "com.bmc.costportal.controllers", "com.bmc.cost.portal"})
@EnableZuulProxy
@SpringBootApplication
public class PortalApplication {
@Bean
public EmbeddedServletContainerCustomizer containerCustomizer() {
return (container -> {
ErrorPage error400Page = new ErrorPage(HttpStatus.BAD_REQUEST,"/error/400.html");
ErrorPage error401Page = new ErrorPage(HttpStatus.UNAUTHORIZED,"/error/401.html");
ErrorPage error404Page = new ErrorPage(HttpStatus.NOT_FOUND,"/error/404.html");
ErrorPage error500Page = new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/error/500.html");
container.addErrorPages(error400Page, error401Page,error404Page, error500Page); });
}
public static void main(String[] args) {
SpringApplication.run(PortalApplication.class, args);
}
}
Ошибка:
[12 сентября 2018 г. 20: 36: 26,702] [ОШИБКА] org.springframework.boot.SpringApplication: сбой запуска приложения: java.lang.NoSuchMethodError: org.springframework.boot.builder.SpringApplicationBuilder (.lang / Class;) V по адресу org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext (BootstrapApplicationListener.java:170) по адресу org.springframework.cloud.bootstrap.BootstrapAwn.pl.bootstrap.BootstrapApplicationListener.onApplicationEvent (BootstrapApplicationListener.java:70) при org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener (SimpleApplicationEventMulticaster.java:172) в org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener (SimpleApplicationEventMulticaster.java:165) в org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent (SimpleApplicationEventMulticaster.java:139) в org.springframework.context.event.SimpleApplicationEventMulticasterj.context.org.springframework.1013 *