Exclude certain WebApplicationInitializers in CloudFoundry WAR deploy

亡梦爱人 提交于 2019-12-11 08:08:06

问题


There's a specific version of this question and a general version; I'll ask it both ways.

Specific Question

We have a traditional Spring Web application that integrates with Apache Camel that we're pushing to Cloud Foundry. It depends on a custom library that pulls in spring-cloud-security (and therefore, spring-boot-autoconfigure, among others). When deploying to Cloud Foundry, the Java Autoreconfiguration looks for WebApplicationInitializers on the classpath and one that it finds is JerseyAutoConfiguration. When it invokes that particular WebApplicationInitializer, we get annotation parsing errors. Is there a way to exclude that one? @EnableAutoConfiguration(exclude=...) doesn't work because this isn't happening during the AutoConfiguration step.

General Question

Is there a way, via web.xml or some other facility, to tell the Java Autoreconfigure code (included via the Java buildpack) to skip executing certain WebApplicationInitializers?


回答1:


If you deploy the app as an executable instead of as a WAR then there is no scanning for WebApplicationInitializers (it's a Spring thing not a buildpack thing).



来源:https://stackoverflow.com/questions/29102977/exclude-certain-webapplicationinitializers-in-cloudfoundry-war-deploy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!