diff --git a/wicket-spring-boot-starter/src/main/java/com/giffing/wicket/spring/boot/starter/configuration/extensions/external/spring/boot/actuator/WicketEndpointConfiguration.java b/wicket-spring-boot-starter/src/main/java/com/giffing/wicket/spring/boot/starter/configuration/extensions/external/spring/boot/actuator/WicketEndpointConfiguration.java index 426f7d47..17a62cde 100644 --- a/wicket-spring-boot-starter/src/main/java/com/giffing/wicket/spring/boot/starter/configuration/extensions/external/spring/boot/actuator/WicketEndpointConfiguration.java +++ b/wicket-spring-boot-starter/src/main/java/com/giffing/wicket/spring/boot/starter/configuration/extensions/external/spring/boot/actuator/WicketEndpointConfiguration.java @@ -1,6 +1,6 @@ package com.giffing.wicket.spring.boot.starter.configuration.extensions.external.spring.boot.actuator; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -9,12 +9,14 @@ @Configuration public class WicketEndpointConfiguration { - @Autowired - private WicketEndpointRepository repo; - @Bean public WicketEndpoint wicketEndpoint() { - return new WicketEndpoint(repo); + return new WicketEndpoint(wicketEndpointRepositoryDefault()); } + @Bean + @ConditionalOnMissingBean + public WicketEndpointRepository wicketEndpointRepositoryDefault() { + return new WicketEndpointRepositoryDefault(); + } } diff --git a/wicket-spring-boot-starter/src/main/java/com/giffing/wicket/spring/boot/starter/configuration/extensions/external/spring/boot/actuator/WicketEndpointRepositoryDefault.java b/wicket-spring-boot-starter/src/main/java/com/giffing/wicket/spring/boot/starter/configuration/extensions/external/spring/boot/actuator/WicketEndpointRepositoryDefault.java index 4e29fcf1..f9a95d25 100644 --- a/wicket-spring-boot-starter/src/main/java/com/giffing/wicket/spring/boot/starter/configuration/extensions/external/spring/boot/actuator/WicketEndpointRepositoryDefault.java +++ b/wicket-spring-boot-starter/src/main/java/com/giffing/wicket/spring/boot/starter/configuration/extensions/external/spring/boot/actuator/WicketEndpointRepositoryDefault.java @@ -8,7 +8,6 @@ import com.giffing.wicket.spring.boot.context.extensions.boot.actuator.WicketAutoConfig; import com.giffing.wicket.spring.boot.context.extensions.boot.actuator.WicketEndpointRepository; -@Component public class WicketEndpointRepositoryDefault implements WicketEndpointRepository { public List wicketAutoConfigurations = new ArrayList<>();