Commit b2fcd77d authored by Phillip Webb's avatar Phillip Webb

Rework EndpointWebMvcAutoConfiguration port logic

Update the `ManagementServerPort` detection logic to attempt direct
property resolution before looking for a local property bean
definition. Bean definitions provided by auto-configuration classes
are ignored.

This change allow `OnManagementMvcCondition` to use the
`ManagementServerPort` to determine when `EndpointWebMvcConfiguration`
should apply (removing the need to create a temporary context).

See gh-3345
parent e885dab7
...@@ -22,6 +22,8 @@ import java.util.List; ...@@ -22,6 +22,8 @@ import java.util.List;
import org.springframework.beans.factory.BeanClassLoaderAware; import org.springframework.beans.factory.BeanClassLoaderAware;
import org.springframework.context.annotation.DeferredImportSelector; import org.springframework.context.annotation.DeferredImportSelector;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.core.io.support.SpringFactoriesLoader; import org.springframework.core.io.support.SpringFactoriesLoader;
import org.springframework.core.type.AnnotationMetadata; import org.springframework.core.type.AnnotationMetadata;
...@@ -32,6 +34,7 @@ import org.springframework.core.type.AnnotationMetadata; ...@@ -32,6 +34,7 @@ import org.springframework.core.type.AnnotationMetadata;
* *
* @author Dave Syer * @author Dave Syer
*/ */
@Order(Ordered.LOWEST_PRECEDENCE)
class EndpointWebMvcImportSelector implements DeferredImportSelector, class EndpointWebMvcImportSelector implements DeferredImportSelector,
BeanClassLoaderAware { BeanClassLoaderAware {
......
...@@ -48,7 +48,7 @@ import org.springframework.util.Assert; ...@@ -48,7 +48,7 @@ import org.springframework.util.Assert;
* @author Stephane Nicoll * @author Stephane Nicoll
* @see EnableAutoConfiguration * @see EnableAutoConfiguration
*/ */
@Order(Ordered.LOWEST_PRECEDENCE) @Order(Ordered.LOWEST_PRECEDENCE - 1)
class EnableAutoConfigurationImportSelector implements DeferredImportSelector, class EnableAutoConfigurationImportSelector implements DeferredImportSelector,
BeanClassLoaderAware, ResourceLoaderAware, BeanFactoryAware { BeanClassLoaderAware, ResourceLoaderAware, BeanFactoryAware {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment