title: APPLICATION FAILED TO START due to same bean
body: <p>I have a <strong>Spring Webflux</strong> application where I am trying to load a dependency from an old module (old module is on <strong>Spring WebMVC</strong> framework). </p>
  
  <p>When the application is launched, this error is thrown - </p>
  
  <pre><code>***************************
  APPLICATION FAILED TO START
  ***************************
  
  Description:
  
  The bean 'requestMappingHandlerAdapter', defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [org/springframework/web/reactive/config/DelegatingWebFluxConfiguration.class] and overriding is disabled.
  
  Action:
  
  Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true
  </code></pre>
  
  <p>I want all the beans from webflux package to be initiated, so I can't set <code>spring.main.allow-bean-definition-overriding=true</code>. </p>
  
  <p>Also tried excluding all classes within org.springframework.boot at the time of component scan - <code>@ComponentScan(excludeFilters = @Filter(type = FilterType.REGEX, pattern = "org.springframework.boot*")</code>. 
  Also tried excluding all spring packages in pom.xml of my webflux project like this -</p>
  
  <pre><code> &lt;exclusion&gt;
      &lt;groupId&gt;org.springframework&lt;/groupId&gt;
      &lt;artifactId&gt;spring-core&lt;/artifactId&gt;
  &lt;/exclusion&gt;
  </code></pre>
  
  <p>Since I cannot modify the older dependency project to webflux, are there any options I could use the make the code work ?</p>